BUGFIX Only replace double slashes in SS_HTTPRequest->__construct() for relative- its a failsafe against wrongly formatted URLs like 'admin//assets' instead of 'admin/assets', but breaks absolute URLs with 'http://' prefix

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103099 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-19 23:04:38 +00:00 committed by Sam Minnee
parent f410107b40
commit 6410432a3a

View File

@ -91,7 +91,9 @@ class SS_HTTPRequest implements ArrayAccess {
$this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars));
$this->url = $url;
$this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'),array('/','',''), $this->url);
if(Director::is_relative_url($url)) {
$this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'),array('/','',''), $this->url);
}
if(preg_match('/^(.*)\.([A-Za-z][A-Za-z0-9]*)$/', $this->url, $matches)) {
$this->url = $matches[1];
$this->extension = $matches[2];