note 111691 deleted from security.globals by aharvey

From: Date: Mon, 18 Mar 2013 16:23:23 +0000
Subject: note 111691 deleted from security.globals by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-194111@lists.php.net to get a copy of this message
Note Submitter: bjarke at bisgaardblendstrup dot dk ---- For those of us with a large legacy code collection depending on register_globals = On and not enough time to fix it, the following will "fix" your problem. YES I KNOW it's bad practice and dangerous etc. etc. but it saved my lazy behind when I upgraded my php and suddenly nothing worked anymore. So use this at your own peril! Step 1: Create this script and put it somewhere readable to all who executes php (apache etc) <?php while (list($n,$v)=each($_GET)) $$n=$v; while (list($n,$v)=each($_POST)) $$n=$v; ?> Step 2: in php.ini find the setting auto_prepend_file and set it to the full path and name of the script. Step 3: If you're using an apache server, restart it. Step 4: Start removing the dependency on register_globals in your code base - this is not meant as a permanent fix but as a quick fix you get your unsafe, dangerous, badly implemented (etc) code working again in a hurry.

« previous php.notes (#194111) next »