- Isolates shortcodes regex into a class method

- Adds a new method to create a URL data object as a numeric array instead
  of associative, thus reducing the size of the object
- Adds a new method to convert numeric URL data object array into associative
  array
- Preserves backward compatibility with previous MP3 Beta versions
  by checking if the URL data object is already an associative array
This commit is contained in:
Vlad
2016-12-11 11:55:50 -05:00
parent 98c6c29716
commit 062f849fc8
2 changed files with 62 additions and 15 deletions

View File

@ -5,6 +5,7 @@ use MailPoet\Models\Newsletter;
use MailPoet\Models\NewsletterLink;
use MailPoet\Models\SendingQueue;
use MailPoet\Models\Subscriber;
use MailPoet\Newsletter\Links\Links;
use MailPoet\Statistics\Track\Clicks;
use MailPoet\Statistics\Track\Opens;
@ -35,10 +36,10 @@ class Track {
}
function _processTrackData($data) {
$data = (object)$data;
$data = (object)Links::transformUrlDataObject($data);
if(empty($data->queue_id) ||
empty($data->subscriber_id) ||
empty($data->subscriber_token)
empty($data->subscriber_id) ||
empty($data->subscriber_token)
) {
return false;
}