mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed stupid ommission from r64223 which caused HTTPRequest to construct without a proper URL
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64227 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
524d7a9011
commit
0fac0752a4
@ -236,11 +236,11 @@ class HTTPRequest extends Object implements ArrayAccess {
|
|||||||
*/
|
*/
|
||||||
function __construct($httpMethod, $url, $getVars = array(), $postVars = array(), $body = null) {
|
function __construct($httpMethod, $url, $getVars = array(), $postVars = array(), $body = null) {
|
||||||
$this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars));
|
$this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars));
|
||||||
|
$this->url = $url;
|
||||||
|
|
||||||
$this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'),array('/','',''), $url);
|
$this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'),array('/','',''), $this->url);
|
||||||
|
if(preg_match('/^(.*)\.([A-Za-z][A-Za-z0-9]*)$/', $this->url, $matches)) {
|
||||||
if(preg_match('/^(.*)\.([A-Za-z][A-Za-z0-9]*)$/', $url, $matches)) {
|
$this->url = $matches[1];
|
||||||
$url = $matches[1];
|
|
||||||
$this->extension = $matches[2];
|
$this->extension = $matches[2];
|
||||||
}
|
}
|
||||||
if($this->url) $this->dirParts = split('/+', $this->url);
|
if($this->url) $this->dirParts = split('/+', $this->url);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user