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

Amit Gupta amit at igeek.info
Sat Jul 2 18:00:51 GMT 2005


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

|| Canned!! -- my Atropine || iG:Syntax Hiliter v2.01 ||
|| iGEEK.INFO || Free Nokia Ringtones || Online Gaming @ Games Planet || 




---------- Original Message from davebytes at comcast.net ----------
I saw Mike just changed the test to empty().  But, I'm not sure if that's valid or not... I'm trying to remember an early conversation with Matt or someone when we originally fixed up that test, and I'm trying to recall if there was a reason isset was used (i.e., the field could validly be empty?).  Anyway, if anyone recalls why !isset() was used instead of empty() in the first place, feel free to comment.  Otherwise, have a happy 4th for those of you in the US. ;)
 
-d

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050702/59b6aefc/attachment.html


More information about the wp-hackers mailing list