Update regex to only match files with names

This commit is contained in:
Ben Speakman 2015-10-08 16:47:14 +01:00 committed by Sam Minnée
parent d119272b92
commit 705d342080

View File

@ -131,7 +131,7 @@ class SS_HTTPRequest implements ArrayAccess {
if(Director::is_relative_url($url) || preg_match('/^\//', $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]*)$/', $this->url, $matches)) {
$this->url = $matches[1];
$this->extension = $matches[2];
}