- Fixes data not being passed to API buildRequest method

This commit is contained in:
Vlad
2016-07-06 09:31:13 -04:00
parent 2db681d908
commit bd814baf28
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,9 @@ class API {
$this->action = isset($_GET['action']) ? $this->action = isset($_GET['action']) ?
Helpers::underscoreToCamelCase($_GET['action']) : Helpers::underscoreToCamelCase($_GET['action']) :
false; false;
$this->data = self::decodeRequestData($_GET['data']); $this->data = isset($_GET['data']) ?
self::decodeRequestData($_GET['data']) :
false;
} }
function init() { function init() {
@ -47,7 +49,6 @@ class API {
} }
static function decodeRequestData($data) { static function decodeRequestData($data) {
if(!$data) return false;
$data = base64_decode($data); $data = base64_decode($data);
return (is_serialized($data)) ? return (is_serialized($data)) ?
unserialize($data) : unserialize($data) :

View File

@ -68,6 +68,7 @@ class Links {
$tracked_link = API::buildRequest( $tracked_link = API::buildRequest(
TrackAPI::ENDPOINT, TrackAPI::ENDPOINT,
TrackAPI::ACTION_CLICK, TrackAPI::ACTION_CLICK,
$data,
$encode_data = false $encode_data = false
); );
// first, replace URL in the extracted HTML source with encoded link // first, replace URL in the extracted HTML source with encoded link