Skip to content

Commit

Permalink
up version
Browse files Browse the repository at this point in the history
  • Loading branch information
龚成 committed Apr 20, 2023
1 parent 4c0f604 commit 63711de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SensorsAnalytics.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

define('SENSORS_ANALYTICS_SDK_VERSION', '2.0.2');
define('SENSORS_ANALYTICS_SDK_VERSION', '2.0.3');

class SensorsAnalyticsException extends \Exception {
}
Expand Down Expand Up @@ -73,7 +73,7 @@ public function __construct1($consumer) {
private function _assert_key_with_regex($key) {
$name_pattern = "/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_group|^user_tag)[a-zA-Z_$][a-zA-Z\\d_$]{0,99})$/i";
if (!preg_match($name_pattern, $key)) {
throw new SensorsAnalyticsIllegalDataException("key must be a valid variable key. [key='${key}']");
throw new SensorsAnalyticsIllegalDataException("key must be a valid variable key. [key='{$key}']");
}
}

Expand Down Expand Up @@ -338,7 +338,7 @@ private function _json_dumps($data) {
*/
private function _set_track_id($data){
$properties = $data['properties'];
$track_id = mt_rand(PHP_INT_MIN,PHP_INT_MAX);
$track_id = mt_rand();
try{
if ($properties && isset($properties['$track_id'])) {
if(is_numeric($properties['$track_id'])){
Expand Down

0 comments on commit 63711de

Please sign in to comment.