문제

I set the "magic_quotes_gpc" with the value "on" in php.ini,just like the following:

; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/magic-quotes-gpc
magic_quotes_gpc = On

but it seems doesn't work and I test this with the following php code:

if(!get_magic_quotes_gpc()){
    echo "hello world<br />";
}

it will always print "hello world",whether it is "on" or "off". addition,I use wampserver 2.4 in my computer!

도움이 되었습니까?

해결책

WampServer 2.4 comes with PHP 5.4, and as the docs say, get_magic_quotes_gpc() always returns false since PHP 5.4.0, for the (horrible) feature was removed from the language. You can't have magic_quotes.

다른 팁

First, you can check your PHP version:

Magic Quotes has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

If you want to implement magic_quotes_gpc on PHP 5.4 above version, you could use yidas/magic-quotes which works the same as magic_quotes_gpc.

https://github.com/yidas/php-magic-quotes

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top