@@ -200,7 +200,7 @@ public function __construct($options = array())
200200 {
201201 case "COOKIE " :
202202 $ this ->cookieName = 'cryptoUsr ' .$ this ->icrc32 ($ this ->boxID ."*&* " .$ this ->coinLabel ."*&* " .$ this ->orderID ."*&* " .$ this ->private_key );
203- if (isset ($ _COOKIE [$ this ->cookieName ]) && trim ($ _COOKIE [$ this ->cookieName ]) && strpos ($ _COOKIE [$ this ->cookieName ], "__ " ) && preg_replace ('/[^A-Za-z0-9\.\_\-\@ ]/ ' , '' , $ _COOKIE [$ this ->cookieName ]) == $ _COOKIE [$ this ->cookieName ] && strlen ($ _COOKIE [$ this ->cookieName ]) <= 30 ) $ this ->userID = trim ($ _COOKIE [$ this ->cookieName ]);
203+ if (isset ($ _COOKIE [$ this ->cookieName ]) && trim ($ _COOKIE [$ this ->cookieName ]) && strpos ($ _COOKIE [$ this ->cookieName ], "__ " ) && preg_replace ('/[^A-Za-z0-9\_ ]/ ' , '' , $ _COOKIE [$ this ->cookieName ]) == $ _COOKIE [$ this ->cookieName ] && strlen ($ _COOKIE [$ this ->cookieName ]) <= 30 ) $ this ->userID = trim ($ _COOKIE [$ this ->cookieName ]);
204204 else
205205 {
206206 $ s = trim (strtolower ($ _SERVER ['SERVER_NAME ' ]), " / " );
@@ -216,7 +216,7 @@ public function __construct($options = array())
216216
217217 if (session_status () == PHP_SESSION_NONE ) session_start ();
218218 $ this ->cookieName = 'cryptoUser ' .$ this ->icrc32 ($ this ->private_key ."*&* " .$ this ->boxID ."*&* " .$ this ->coinLabel ."*&* " .$ this ->orderID );
219- if (isset ($ _SESSION [$ this ->cookieName ]) && trim ($ _SESSION [$ this ->cookieName ]) && strpos ($ _SESSION [$ this ->cookieName ], "-- " ) && preg_replace ('/[^A-Za-z0-9\.\_\-\@ ]/ ' , '' , $ _SESSION [$ this ->cookieName ]) == $ _SESSION [$ this ->cookieName ] && strlen ($ _SESSION [$ this ->cookieName ]) <= 30 ) $ this ->userID = trim ($ _SESSION [$ this ->cookieName ]);
219+ if (isset ($ _SESSION [$ this ->cookieName ]) && trim ($ _SESSION [$ this ->cookieName ]) && strpos ($ _SESSION [$ this ->cookieName ], "-- " ) && preg_replace ('/[^A-Za-z0-9\- ]/ ' , '' , $ _SESSION [$ this ->cookieName ]) == $ _SESSION [$ this ->cookieName ] && strlen ($ _SESSION [$ this ->cookieName ]) <= 30 ) $ this ->userID = trim ($ _SESSION [$ this ->cookieName ]);
220220 else
221221 {
222222 $ d = time (); if ($ d > 1410000000 ) $ d -= 1410000000 ;
@@ -228,7 +228,7 @@ public function __construct($options = array())
228228 case "IPADDRESS " :
229229
230230 if (session_status () == PHP_SESSION_NONE ) session_start ();
231- if (isset ($ _SESSION ['cryptoUserIP ' ]) && filter_var ($ _SESSION ['cryptoUserIP ' ], FILTER_VALIDATE_IP ) && preg_replace ('/[^A-Za-z0-9\.\:]/ ' , '' , $ _SESSION ['cryptoUserIP ' ]) == $ _SESSION ['cryptoUserIP ' ])
231+ if (isset ($ _SESSION ['cryptoUserIP ' ]) && filter_var ($ _SESSION ['cryptoUserIP ' ], FILTER_VALIDATE_IP ) && preg_replace ('/[^A-Za-z0-9\.\:]/ ' , '' , $ _SESSION ['cryptoUserIP ' ]) == $ _SESSION ['cryptoUserIP ' ] && strlen ( $ _SESSION [ ' cryptoUserIP ' ]) <= 50 )
232232 $ ip = $ _SESSION ['cryptoUserIP ' ];
233233 else $ ip = $ _SESSION ['cryptoUserIP ' ] = $ this ->ip_address ();
234234 $ this ->userID = trim (md5 ($ ip ."*&* " .$ this ->boxID ."*&* " .$ this ->coinLabel ."*&* " .$ this ->orderID ));
@@ -1608,8 +1608,8 @@ function cryptobox_sellanguage($default = "en")
16081608 else return CRYPTOBOX_LANGUAGE ;
16091609 }
16101610
1611- if (isset ($ _GET [$ id ]) && in_array ($ _GET [$ id ], array_keys ($ localisation )) && !defined ("CRYPTOBOX_LANGUAGE_HTMLID_IGNORE " )) { $ lan = $ _GET [$ id ]; setcookie ($ id , $ lan , time ()+7 *24 *3600 , "/ " ); }
1612- elseif (isset ($ _COOKIE [$ id ]) && in_array ($ _COOKIE [$ id ], array_keys ($ localisation )) && !defined ("CRYPTOBOX_LANGUAGE_HTMLID_IGNORE " ) && preg_replace ('/[^A-Za-z0-9]/ ' , '' , $ _COOKIE [$ id ]) == $ _COOKIE [$ id ] && strlen ($ _COOKIE [$ id ]) <= 30 ) $ lan = $ _COOKIE [$ id ];
1611+ if (isset ($ _GET [$ id ]) && in_array ($ _GET [$ id ], array_keys ($ localisation )) && !defined ("CRYPTOBOX_LANGUAGE_HTMLID_IGNORE " ) && preg_replace ( ' /[^A-Za-z0-9]/ ' , '' , $ _GET [ $ id ]) == $ _GET [ $ id ] && strlen ( $ _GET [ $ id ]) <= 5 ) { $ lan = $ _GET [$ id ]; setcookie ($ id , $ lan , time ()+7 *24 *3600 , "/ " ); }
1612+ elseif (isset ($ _COOKIE [$ id ]) && in_array ($ _COOKIE [$ id ], array_keys ($ localisation )) && !defined ("CRYPTOBOX_LANGUAGE_HTMLID_IGNORE " ) && preg_replace ('/[^A-Za-z0-9]/ ' , '' , $ _COOKIE [$ id ]) == $ _COOKIE [$ id ] && strlen ($ _COOKIE [$ id ]) <= 5 ) $ lan = $ _COOKIE [$ id ];
16131613 elseif (in_array ($ default , array_keys ($ localisation ))) $ lan = $ default ;
16141614 else $ lan = "en " ;
16151615
@@ -1646,8 +1646,8 @@ function cryptobox_selcoin($coins = array(), $default = "")
16461646
16471647
16481648 // Current Selected Coin
1649- if (isset ($ _GET [$ id ]) && in_array ($ _GET [$ id ], $ available_payments ) && in_array ($ _GET [$ id ], $ coins )) { $ coinName = $ _GET [$ id ]; setcookie ($ id , $ coinName , time ()+7 *24 *3600 , "/ " ); }
1650- elseif (isset ($ _COOKIE [$ id ]) && in_array ($ _COOKIE [$ id ], $ available_payments ) && in_array ($ _COOKIE [$ id ], $ coins ) && preg_replace ('/[^A-Za-z0-9]/ ' , '' , $ _COOKIE [$ id ]) == $ _COOKIE [$ id ] && strlen ($ _COOKIE [$ id ]) <= 30 ) $ coinName = $ _COOKIE [$ id ];
1649+ if (isset ($ _GET [$ id ]) && in_array ($ _GET [$ id ], $ available_payments ) && in_array ($ _GET [$ id ], $ coins ) && preg_replace ( ' /[^A-Za-z0-9]/ ' , '' , $ _GET [ $ id ]) == $ _GET [ $ id ] && strlen ( $ _GET [ $ id ]) <= 25 ) { $ coinName = $ _GET [$ id ]; setcookie ($ id , $ coinName , time ()+7 *24 *3600 , "/ " ); }
1650+ elseif (isset ($ _COOKIE [$ id ]) && in_array ($ _COOKIE [$ id ], $ available_payments ) && in_array ($ _COOKIE [$ id ], $ coins ) && preg_replace ('/[^A-Za-z0-9]/ ' , '' , $ _COOKIE [$ id ]) == $ _COOKIE [$ id ] && strlen ($ _COOKIE [$ id ]) <= 25 ) $ coinName = $ _COOKIE [$ id ];
16511651 else $ coinName = $ default ;
16521652
16531653 $ current = $ coinName ;
@@ -2386,6 +2386,6 @@ function run_sql($sql)
23862386 foreach ($ cryptobox_private_keys as $ v )
23872387 if (strpos ($ v , " " ) !== false || strpos ($ v , "PRV " ) === false || strpos ($ v , "AA " ) === false || strpos ($ v , "77 " ) === false ) die ("Invalid Private Key - " . (CRYPTOBOX_WORDPRESS ? "please setup it on your plugin settings page " : "$ v in variable \$cryptobox_private_keys, file cryptobox.config.php. " ));
23882388
2389- unset($ v ); unset($ cryptobox_private_keys );
2389+ unset($ v ); unset($ cryptobox_private_keys );
23902390 }
23912391?>
0 commit comments