웹 및 클래식 호스팅 도움말

Disable Magic Quotes

Magic Quotes is a process that automatically escapes incoming data to the PHP script. However, it can cause issues for your website and you might need to disable it.

Note: Since the release of PHP 5.3.0, this feature has been deprecated.

There are a few ways you can disable Magic Quotes:

Disabling Magic Quotes Server Side via php5.ini

Add this code to your php5.ini file:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

If the hosting account does not have a php5.ini file, you have to add one.

For this change to take effect, you might need to stop your account's PHP process. For more information, see Manage system process (Linux).

Disabling Magic Quotes at Runtime

Place code at top of the .php file so it executes when the file runs:

<?php
if (get_magic_quotes_gpc()) {
    function magicQuotes_awStripslashes(&$value, $key) {$value = stripslashes($value);}
    $gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    array_walk_recursive($gpc, 'magicQuotes_awStripslashes');
}
?>

Note: The magic_quotes_gpc directive may only be disabled at the system level, and not at runtime.

For more information regarding Magic Quotes please refer to php.net.


이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.