[wp-hackers] REQUEST_URI fix in wp-settings.php doesn't work

Mike Little journalized at gmail.com
Sat Jul 2 19:06:38 GMT 2005


On 02/07/05, Amit Gupta <amit at igeek.info> wrote:
> what I was proposing is not using only empty() or only isset(). I think that
> using both would be much better as then it can be checked whether
> $_SERVER['REQUEST_URI'] is set or not & if its set then it shouldn't be
> empty.
> 
> so this would be much better
> 
> if (!isset($_SERVER['REQUEST_URI']) ||
> empty($_SERVER['REQUEST_URI'])) {
>     $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
>     
>     // Append the query string if it exists and isn't null
>     if (isset($_SERVER['QUERY_STRING']) &&
> !empty($_SERVER['QUERY_STRING'])) {
>         $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
>     }
> }
> 
> 
> -----
> Amit Gupta
> 


Given that an unset variable (!unset == true) evaluates to empty
(without errors) I  think that makes the test for !unset redundant.


Mike
-- 
Mike Little
http://zed1.com/journalized/


More information about the wp-hackers mailing list