note 90928 added to security.filesystem.nullbytes

From: Date: Sat, 16 May 2009 19:25:34 +0000
Subject: note 90928 added to security.filesystem.nullbytes
Groups: php.notes 
Request: Send a blank email to php-notes+get-154675@lists.php.net to get a copy of this message
Since problems with null bytes do not stretch to regular string functions, this should be enough to ensure no GET parameter contains them any more: <?php function getVar($name) { $value = isset($_GET[$name]) ? $_GET[$name] : null; if (is_string($value)) { $value = str_replace("\0", '', $value); } } ?> Modifying this to work with other superglobals should not be a problem, so I will leave it up to you. ---- Server IP: 213.186.192.247 Probable Submitter: 194.187.111.86 ---- Manual Page -- http://www.php.net/manual/en/security.filesystem.nullbytes.php Edit -- https://master.php.net/note/edit/90928 Del: integrated -- https://master.php.net/note/delete/90928/integrated Del: useless -- https://master.php.net/note/delete/90928/useless Del: bad code -- https://master.php.net/note/delete/90928/bad+code Del: spam -- https://master.php.net/note/delete/90928/spam Del: non-english -- https://master.php.net/note/delete/90928/non-english Del: in docs -- https://master.php.net/note/delete/90928/in+docs Del: other reasons-- https://master.php.net/note/delete/90928 Reject -- https://master.php.net/note/reject/90928 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154675) next »