Topic: get_magic_quotes_gpc is depreciated in php version 7.0

Hi Experts,

while upgrading the php version from 5.6 to 7.0 it is giving error get_magic_quotes_gpc is depreciated.

Regards,
Zia

2 (edited by kvvaradha 03/18/2020 09:43:42 am)

Re: get_magic_quotes_gpc is depreciated in php version 7.0

Hello,

Your PHP version must be 7.4. From this version the get_magic_quotes_gpc was deprecated. And there is no alternative to use it. So lets take out the code and make it work on. This function available inside session.inc and isession.inc.

function strip_quotes($data)
{
    if(get_magic_quotes_gpc()) {
        if(is_array($data)) {
            foreach($data as $k => $v) {
                $data[$k] = strip_quotes($data[$k]);
            }
            return $data;
        } else
            return stripslashes($data);
    }
   
}

And just remove the if condition like this

function strip_quotes($data)
{
        if(is_array($data)) {
            foreach($data as $k => $v) {
                $data[$k] = strip_quotes($data[$k]);
            }
           return $data;
        } else
            return stripslashes($data);
    
    
}

.

Hope it will fix your problem to work on.  if its fixed just reply to this conversation, @joe will update to the core.

Subscription service based on FA
HRM CRM POS batch Themes

Re: get_magic_quotes_gpc is depreciated in php version 7.0

This seems to be the way to do it. Have just consulted Janusz about it. Awaiting his comment.

Joe

Re: get_magic_quotes_gpc is depreciated in php version 7.0

Let's get clients feedback before move on with it. I heard it was no more and no further alternative to use it.

Subscription service based on FA
HRM CRM POS batch Themes

Re: get_magic_quotes_gpc is depreciated in php version 7.0

Links with information about get_magic_quotes_gpc()

https://www.php.net/manual/en/security.magicquotes.php
https://www.php.net/manual/en/function.get-magic-quotes-gpc.php

Regards.

cleal