マジッククオートの設定
広告
マジッククオートとは自動的にエスケープ処理を行うかどうかの設定です。有効にすることでエスケープが必要な時に自動でエスケープ処理を行ってくれますが、色々と問題になることがあるため設定は無効にしておき必要なエスケープ処理を自分で行うことが推奨されています。
現時点の"php.ini"ファイルでは次のように記述されています。
; Magic quotes are a preprocessing feature of PHP where PHP will attempt to ; escape any character sequences in GET, POST, COOKIE and ENV data which might ; otherwise corrupt data being placed in resources such as databases before ; making that data available to you. Because of character encoding issues and ; non-standard SQL implementations across many databases, it's not currently ; possible for this feature to be 100% accurate. PHP's default behavior is to ; enable the feature. We strongly recommend you use the escaping mechanisms ; designed specifically for the database your using instead of relying on this ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is ; scheduled for removal in PHP 6. ; Default Value: On ; Development Value: Off ; Production Value: Off ; http://php.net/magic-quotes-gpc magic_quotes_gpc = Off ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. ; http://php.net/magic-quotes-runtime magic_quotes_runtime = Off ; Use Sybase-style magic quotes (escape ' with '' instead of \'). ; http://php.net/magic-quotes-sybase magic_quotes_sybase = Off
現時点で全てOffに設定されていますので変更は不要です。
phpinfo関数が含まれるファイルをブラウザで開き設定を確認してみます。
「magic_quotes_gpc」「magic_quotes_runtime」「magic_quotes_sybase」の値として全て"Off"が設定されていることが確認できます。
( Written by T.buzz.Ikura+ )
Facebook Page