Re: Full versus relative URLs

From: Date: Tue, 17 Feb 2009 17:21:03 +0000
Subject: Re: Full versus relative URLs
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-288453@lists.php.net to get a copy of this message
I know it's been said before, but beware of relying on this value just for the sole purpose of deciding where things are located, as without a bit of error checking on it, it can be used for injection attacks and what-not, although, sadly, I forget the exact post recently that had the link that explained this issue on PHP_SELF.
    
Alternatively, $_SERVER['PHP_SELF']) could be switch()ed for known values, and $path be set accordingly with hardcoded values. Didn't notice this thread passing from the list. I will look into it.
But sometimes you need to detect where something is located and that's the point of the whole conversation. If you hardcode the values then you need to change them while renaming or moving files and directories So what someone should do to accomplish such a behavior? Without being vulnerable to injection attacks of course. -- Thodoris

« previous php.general (#288453) next »