Scl wrote: > Hello, > I have just upgraded to PHP 4.2.0 and straight away one of our custom PHP > extenstions reported an error (couldn't get SCRIPT_NAME): > > Scripthash Security Extension - http://www.scl.co.uk/scripthash/ > > The reason for this seems to be that a global variable I need SCRIPT_NAME has > been moved into the $_SERVER superglobal. As a quick, temporary fix I enabled > register_globals in the .ini file, this worked fine. My next task was to find > out how I should really do this so I had a look through some of the provided > PHP extenstions and I noticed that session.c (and several other modules) was > using the same method to fetch HTTP_REFERER and REQUEST_URI as I was using to > fetch SCRIPT_NAME which is using the zend_hash_find() function. > > Does this mean that in order for the session extension to work properly > register_globals has to be enabled or have I overlooked something. What method > should I now be using to fetch variables inside the superglobals from with in > my extension source code. I know I could use getenv() for this particular > example but what is the alternative.
Yes, session module HTTP_REFERER check does not work unless register global is on. We should really clean up variable registration. There are problems in variable_order, etc. It's known issue... -- Yasuo Ohgaki -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php