note 111691 added to security.globals

From: Date: Sun, 17 Mar 2013 19:32:52 +0000
Subject: note 111691 added to security.globals
Groups: php.notes 
Request: Send a blank email to php-notes+get-194101@lists.php.net to get a copy of this message
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. ---- Server IP: 69.147.83.199 Probable Submitter: 188.183.159.19 ---- Manual Page -- http://php.net/manual/en/security.globals.php Edit -- https://master.php.net/note/edit/111691 Del: integrated -- https://master.php.net/note/delete/111691/integrated Del: useless -- https://master.php.net/note/delete/111691/useless Del: bad code -- https://master.php.net/note/delete/111691/bad+code Del: spam -- https://master.php.net/note/delete/111691/spam Del: non-english -- https://master.php.net/note/delete/111691/non-english Del: in docs -- https://master.php.net/note/delete/111691/in+docs Del: other reasons-- https://master.php.net/note/delete/111691 Reject -- https://master.php.net/note/reject/111691 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194101) next »