File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5783,10 +5783,11 @@ function getHostOnlyFromURL($url) {
57835783 */
57845784function getDeviceID ($ useRandomString = true ) {
57855785 $ ip = md5 (getRealIpAddr ());
5786+ $ pattern = "/[0-9a-z_.-]/i " ;
57865787 if (empty ($ _SERVER ['HTTP_USER_AGENT ' ])) {
57875788 $ device = "unknowDevice- {$ ip }" ;
57885789 $ device .= '- ' . intval (User::getId ());
5789- return $ device ;
5790+ return preg_replace ( $ pattern , ' - ' , $ device) ;
57905791 }
57915792
57925793 if (empty ($ useRandomString )) {
@@ -5797,7 +5798,7 @@ function getDeviceID($useRandomString = true) {
57975798 $ device
57985799 );
57995800 $ device .= '- ' . intval (User::getId ());
5800- return $ device ;
5801+ return preg_replace ( $ pattern , '' , $ device) ;
58015802 }
58025803
58035804 $ cookieName = "yptDeviceID " ;
@@ -5816,9 +5817,8 @@ function getDeviceID($useRandomString = true) {
58165817 return "getDeviceIDError " ;
58175818 }
58185819 $ _COOKIE [$ cookieName ] = $ _GET [$ cookieName ];
5819- return $ _GET [$ cookieName ];
58205820 }
5821- return $ _COOKIE [$ cookieName ];
5821+ return preg_replace ( $ pattern , '' , $ _COOKIE [$ cookieName ]) ;
58225822}
58235823
58245824function deviceIdToObject ($ deviceID ) {
You can’t perform that action at this time.
0 commit comments