It seems that the Redirect function does not remove the Query string before appending the relative path to the current path. My issue arose because I had a path in the query string:
$this->request_uri = "http://www.example.com/path/?SITEPATH=/somepath/"
So the code took up to the last '/' from the query string.
A simple fix would be to use this block instead:
if(strncmp($location,"/",1) !== 0)
{
$request_parts = explode('?', $this->request_uri);
$location_arguments=@parse_url($location);
if(!IsSet($location_arguments["scheme"]))
{
$end = strrpos($request_parts[0],"/");
if ($end !== false && $end > 0)
{
$request_parts[0] = substr($request_parts[0],0,$end)."/".$location;
}
else
{
$request_parts[0] = $request_parts[0]."/".$location;
}
$location = implode('?', $request_parts);
}
}
Best Regards,
Kepler Gelotte
neighborwebmaster.com