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:
Ingo Schommer 2008-10-14 19:53:59 +00:00
parent 524d7a9011
commit 0fac0752a4

View File

@ -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);