File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use GuzzleHttp \Psr7 \Request ;
66use GuzzleHttp \Exception \RequestException ;
7+ use phpDocumentor \Reflection \Types \Array_ ;
78
89class EventManager
910{
@@ -27,9 +28,10 @@ public function buildEvent(EventOptions $opts)
2728 $ clientFP = json_decode ($ cookieDecoded );
2829 $ eventType = $ opts ->eventType ? $ opts ->eventType : EventTypes::LOG_IN ;
2930
30- $ cid = $ clientFP ->cid ? $ clientFP ->cid : '' ;
31+ $ cid = $ clientFP && $ clientFP ->cid ? $ clientFP ->cid : '' ;
32+ $ fp = $ clientFP && $ clientFP ->fp ? $ clientFP ->fp : '' ;
33+
3134 $ vid = Utils::generateGuidV4 ();
32- $ fp = $ clientFP ->fp ? $ clientFP ->fp : '' ;
3335 $ ip = $ opts ->ip ? $ opts ->ip : Utils::clientIpFromRequest ();
3436 $ remoteIP = $ opts ->remoteIp ? $ opts ->remoteIp : Utils::clientIpFromRequest ();
3537 $ userAgent = $ opts ->userAgent ? $ opts ->userAgent : Utils::userAgentFromRequest ();
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public static function track(Array $attributes)
3434 throw new Exception ("Can't send empty attributes " );
3535 }
3636
37- if (count ($ opts ->params ) > MAX_CUSTOM_PARAMS ) {
37+ if (isset ( $ opts -> params ) && count ($ opts ->params ) > MAX_CUSTOM_PARAMS ) {
3838 throw new Exception (sprintf ('You can only specify maximum of %d params ' , MAX_CUSTOM_PARAMS ));
3939 }
4040
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ public static function userAgentFromRequest()
3434
3535 public static function securHeaderFromRequest ()
3636 {
37- if (array_key_exists ('HTTTP_X_SECURENATIVE ' , $ _SERVER )) {
38- return $ _SERVER ['HTTTP_X_SECURENATIVE ' ];
37+ if (array_key_exists ('HTTP_X_SECURENATIVE ' , $ _SERVER )) {
38+ return $ _SERVER ['HTTP_X_SECURENATIVE ' ];
3939 }
4040 return '' ;
4141 }
You can’t perform that action at this time.
0 commit comments