mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f410107b40
commit
6410432a3a
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user