From bd814baf28a3cced764f67c9dfddcdcd9202b3a5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 6 Jul 2016 09:31:13 -0400 Subject: [PATCH] - Fixes data not being passed to API buildRequest method --- lib/API/API.php | 5 +++-- lib/Newsletter/Links/Links.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/API/API.php b/lib/API/API.php index 259dec4ef3..a2944869a0 100644 --- a/lib/API/API.php +++ b/lib/API/API.php @@ -22,7 +22,9 @@ class API { $this->action = isset($_GET['action']) ? Helpers::underscoreToCamelCase($_GET['action']) : false; - $this->data = self::decodeRequestData($_GET['data']); + $this->data = isset($_GET['data']) ? + self::decodeRequestData($_GET['data']) : + false; } function init() { @@ -47,7 +49,6 @@ class API { } static function decodeRequestData($data) { - if(!$data) return false; $data = base64_decode($data); return (is_serialized($data)) ? unserialize($data) : diff --git a/lib/Newsletter/Links/Links.php b/lib/Newsletter/Links/Links.php index de22173585..201d34e78c 100644 --- a/lib/Newsletter/Links/Links.php +++ b/lib/Newsletter/Links/Links.php @@ -68,6 +68,7 @@ class Links { $tracked_link = API::buildRequest( TrackAPI::ENDPOINT, TrackAPI::ACTION_CLICK, + $data, $encode_data = false ); // first, replace URL in the extracted HTML source with encoded link