SmItH197 / SteamAuthentication

A simple PHP Authentication that enables steam users to log into their steam account to access content!
MIT License
446 stars 145 forks source link

Function get_magic_quotes_gpc() is deprecated in openid.php #262

Closed mpavel27 closed 2 years ago

mpavel27 commented 2 years ago

Hello there, For any reason, I don't know why I get this error after I log in with my steam account.

_Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/teee/publichtml/test/inc/steamauth/openid.php on line 921

Basically, the whole story is that I've tried to connect with my steam account, and after the session is set gives me this error 7 times.

foreach (explode(',', $this->data['openid_signed']) as $item) {
            # Checking whether magic_quotes_gpc is turned on, because
            # the function may fail if it is. For example, when fetching
            # AX namePerson, it might contain an apostrophe, which will be escaped.
            # In such case, validation would fail, since we'd send different data than OP
            # wants to verify. stripslashes() should solve that problem, but we can't
            # use it when magic_quotes is off.
            $value = $this->data['openid_' . str_replace('.','_',$item)];
            HERE IS THE ERROR -- $params['openid.' . $item] = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ? stripslashes($value) : $value;
}
BlackCetha commented 2 years ago

Relevant documentation: https://www.php.net/manual/de/function.get-magic-quotes-gpc.php It seems like the entire branch of functions is now deprecated and removed, starting with PHP 5.3.

The OpenID library (in steamauth/openid.php) is a dependency. You might get away with swapping it out yourself and fixing compatibility issues. If you get around to doing that, a PR would be nice. Otherwise the project is incompatible with PHP 8 for the time being. The old and deprecated library can be found here: https://github.com/iignatov/LightOpenID (last release in 2016)

mpavel27 commented 2 years ago

Alright, thanks for your time. I will give it a try and post a PR.