note 77595 added to ref.strings
| From: | janturon at email dot cz | Date: | Wed, 05 Sep 2007 10:39:04 +0000 |
| Subject: | note 77595 added to ref.strings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130196@lists.php.net to get a copy of this message | ||
be aware of this string behavior:
$array= "foo";
echo $array["bar"]; // "f"
explanation:
$array is string, so $array["bar"] is evaluated as $array[0] and this is the first
character of "foo".
if someone passes string into your associative array (get, post or cookie), it is security risk,
i.e.:
isset($array["user_exists"]); // true!
use array_key_exists() instead!
----
Server IP: 212.24.129.51
Probable Submitter: 81.2.196.33
----
Manual Page -- http://www.php.net/manual/en/ref.strings.php
Edit -- https://master.php.net/note/edit/77595
Del: integrated -- https://master.php.net/note/delete/77595/integrated
Del: useless -- https://master.php.net/note/delete/77595/useless
Del: bad code -- https://master.php.net/note/delete/77595/bad+code
Del: spam -- https://master.php.net/note/delete/77595/spam
Del: non-english -- https://master.php.net/note/delete/77595/non-english
Del: in docs -- https://master.php.net/note/delete/77595/in+docs
Del: other reasons-- https://master.php.net/note/delete/77595
Reject -- https://master.php.net/note/reject/77595
Search -- https://master.php.net/manage/user-notes.php