note 87833 added to security.globals

From: Date: Thu, 25 Dec 2008 07:43:56 +0000
Subject: note 87833 added to security.globals
Groups: php.notes 
Request: Send a blank email to php-notes+get-148502@lists.php.net to get a copy of this message
-greetz subarea- I was looking at this post that you put here, and I am needing some help in getting this done. I use Joomla as part of my content building on my website and I host my website via Yahoo. I dont have the persmissions to any of the PHP settings, nor can I add a .htaccess in my root folder (don't have the persmissions as well). I was reading this as a work around for me, but I don't know where to put this code within my Joomla website. Are you familiar with Joomla at all? Any help would be greatfull. My email is rblynes@yahoo.com Thanks, Robert ======== your webspace provider has register-globals activated by standard and you don't have a chance to turn it off? no problem anymore, here is your solution... <?php // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // this is just a workaround to kill all through register globals imported vars! // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // place this script after session_start() to be sure you unregister_globals('_SESSION'); // that's all, now all through "register_globals" assigned vars are deleted from scope. // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ if (ini_get('register_globals') == 1) { if (is_array($_REQUEST)) foreach(array_keys($_REQUEST) as $var_to_kill) unset($$var_to_kill); if (is_array($_SESSION)) foreach(array_keys($_SESSION) as $var_to_kill) unset($$var_to_kill); if (is_array($_SERVER)) foreach(array_keys($_SERVER) as $var_to_kill) unset($$var_to_kill); unset($var_to_kill); } ?> hope you like it ;) greetz subarea ---- Server IP: 208.69.120.35 Probable Submitter: 74.243.117.198 ---- Manual Page -- http://www.php.net/manual/en/security.globals.php Edit -- https://master.php.net/note/edit/87833 Del: integrated -- https://master.php.net/note/delete/87833/integrated Del: useless -- https://master.php.net/note/delete/87833/useless Del: bad code -- https://master.php.net/note/delete/87833/bad+code Del: spam -- https://master.php.net/note/delete/87833/spam Del: non-english -- https://master.php.net/note/delete/87833/non-english Del: in docs -- https://master.php.net/note/delete/87833/in+docs Del: other reasons-- https://master.php.net/note/delete/87833 Reject -- https://master.php.net/note/reject/87833 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#148502) next »