Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Handle people passing in non-arrays as properties
Browse files Browse the repository at this point in the history
  • Loading branch information
leahciMic committed May 6, 2014
1 parent f9d120c commit f14e069
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Analytics/Consumer/Fornax.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ public function track($user_id, $event, $properties, $context, $timestamp) {
$event = 'MissingDomain.' . ltrim($event, '.');
}

if (!is_array($properties)) {
// if a non-array was passed, create an array out of it
if (!empty($properties)) {
$properties = array(
'message' => $properties
);
} else {
$properties = array();
}
}

if (isset($this->options['defaultProperties'])) {
$properties = array_merge($properties, $this->options['defaultProperties']);
}
Expand Down

0 comments on commit f14e069

Please sign in to comment.