note 66184 added to function.get-magic-quotes-gpc

From: Date: Tue, 16 May 2006 19:06:49 +0000
Subject: note 66184 added to function.get-magic-quotes-gpc
Groups: php.notes 
Request: Send a blank email to php-notes+get-111402@lists.php.net to get a copy of this message
get_magic_quotes_gpc() returns an Integer, 0 or 1, and not a Boolean. The expression (!get_magic_quotes_gpc()) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE. So, the right way to check if magic quotes is ON or OFF is: ((bool)get_magic_quotes_gpc() == TRUE)) ? (expr2) : (expr3); and not… (!get_magic_quotes_gpc()) ? (expr2) : (expr3); ---- Server IP: 84.18.202.180 Probable Submitter: 86.141.122.251 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php Edit -- http://master.php.net/note/edit/66184 Del: integrated -- http://master.php.net/note/delete/66184/integrated Del: useless -- http://master.php.net/note/delete/66184/useless Del: bad code -- http://master.php.net/note/delete/66184/bad+code Del: spam -- http://master.php.net/note/delete/66184/spam Del: non-english -- http://master.php.net/note/delete/66184/non-english Del: in docs -- http://master.php.net/note/delete/66184/in+docs Del: other reasons-- http://master.php.net/note/delete/66184 Reject -- http://master.php.net/note/reject/66184 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111402) next »