Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the message get_magic_quotes_gpc() is deprecated for PHP 7.4 #149

Closed
wants to merge 1 commit into from
Closed

Fixes the message get_magic_quotes_gpc() is deprecated for PHP 7.4 #149

wants to merge 1 commit into from

Conversation

alebak
Copy link

@alebak alebak commented Feb 25, 2021

Check if PHP is a version lower than 7.4 to execute the get_magic_quotes_gpc function.

fix #148

… higher

Check if PHP is a version lower than 7.4 to execute the get_magic_quotes_gpc function.

fix #148
@alebak alebak changed the title fixes the message get_magic_quotes_gpc() is deprecated for PHP 7.4 Fixes the message get_magic_quotes_gpc() is deprecated for PHP 7.4 Feb 25, 2021
@alebak alebak closed this by deleting the head repository Oct 23, 2022
@EHLOVader
Copy link

This appears to still be an issue, in fact in 8 get_magic_quotes_gpc was removed so it is a fatal error now.

I can see why the PR might not have been merged though, the check of magic quotes status should still be done, so it should check for version first then it needs to call get_magic_quotes_gpc

/*
|--------------------------------------------------------------------------
| Disable magic quotes
|--------------------------------------------------------------------------
|
| PHP 5.2 and 5.3 can have magic quotes enabled on the whole PHP install.
| http://support.pimpmylog.com/discussions/problems/56-regex-tester-match-is-not-a-valid-associative-array
|
*/
if (  version_compare(PHP_VERSION, '7.4', '<') &&
      get_magic_quotes_gpc() )
{
	$process = array( &$_GET , &$_POST , &$_COOKIE , &$_REQUEST );
	while ( list( $key , $val ) = each( $process ) )
	{
		foreach ( $val as $k => $v )
		{
			unset( $process[ $key ][ $k ] );
			if ( is_array( $v ) )
			{
				$process[ $key ][ stripslashes( $k ) ] = $v;
				$process[]                             = &$process[ $key ][ stripslashes( $k ) ];
			}
			else
			{
				$process[ $key ][ stripslashes( $k ) ] = stripslashes( $v );
			}
		}
	}
	unset( $process );
}

This needs a whole new PR and remote branch right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function get_magic_quotes_gpc() is deprecated
2 participants