note 31378 added to security.registerglobals

From: Date: Sat, 19 Apr 2003 07:55:08 +0000
Subject: note 31378 added to security.registerglobals
Groups: php.notes 
Request: Send a blank email to php-notes+get-46809@lists.php.net to get a copy of this message
Quite a few of the above examples of automatically registering globals ignore the $_FILES (or $HTTP_POST_FILES) superglobal. These are also a little more complex because these are multi-dimensional associative arrays. Before posting a simplified function to register file data, I'll note again that this probably shouldn't be used except to get code working quickly while updating it to use unregistered globals (and even then you're probably better turning global registration on for the site). function registerFiles(){ global $HTTP_POST_FILES; foreach( $HTTP_POST_FILES as $varname => $fileinfo ){ $GLOBALS[$varname] = $fileinfo["tmp_name"]; $GLOBALS[$varname.'_name'] = $fileinfo["name"]; } } -- http://www.php.net/manual/en/security.registerglobals.php http://master.php.net/manage/user-notes.php?action=edit+31378 http://master.php.net/manage/user-notes.php?action=delete+31378 http://master.php.net/manage/user-notes.php?action=reject+31378

« previous php.notes (#46809) next »