note 113106 added to security.globals

From: Date: Fri, 30 Aug 2013 04:23:45 +0000
Subject: note 113106 added to security.globals
Groups: php.notes 
Request: Send a blank email to php-notes+get-196126@lists.php.net to get a copy of this message
<?php /* Forces all GET and POST globals to register and be magically quoted. * This forced register_globals and magic_quotes_gpc both act as if * they were turned ON even if turned off in your php.ini file. * * Reason behind forcing register_globals and magic_quotes is for legacy * PHP scripts that need to run with PHP 5.4 and higher. PHP 5.4+ no longer * support register_globals and magic_quotes, which breaks legacy PHP code. * * This is used as a workaround, while you upgrade your PHP code, yet still * allows you to run in a PHP 5.4+ environment. * * Licenced under the GPLv2. Matt Kukowski Sept. 2013 */ if (! isset($PXM_REG_GLOB)) { $PXM_REG_GLOB = 1; if (! ini_get('register_globals')) { foreach (array_merge($_GET, $_POST) as $key => $val) { global $$key; $$key = (get_magic_quotes_gpc()) ? $val : addslashes($val); } } if (! get_magic_quotes_gpc()) { foreach ($_POST as $key => $val) $_POST[$key] = addslashes($val); foreach ($_GET as $key => $val) $_GET[$key] = addslashes($val); } } ?> ---- Server IP: 69.147.83.199 Probable Submitter: 67.160.68.19 ---- Manual Page -- http://php.net/manual/en/security.globals.php Edit -- https://master.php.net/note/edit/113106 Del: integrated -- https://master.php.net/note/delete/113106/integrated Del: useless -- https://master.php.net/note/delete/113106/useless Del: bad code -- https://master.php.net/note/delete/113106/bad+code Del: spam -- https://master.php.net/note/delete/113106/spam Del: non-english -- https://master.php.net/note/delete/113106/non-english Del: in docs -- https://master.php.net/note/delete/113106/in+docs Del: other reasons-- https://master.php.net/note/delete/113106 Reject -- https://master.php.net/note/reject/113106 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196126) next »