mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed generation of static cache files in subdirectories. (from r88569)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89183 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8db398a409
commit
b25427c732
@ -202,10 +202,7 @@ class Director {
|
|||||||
if (@parse_url($url, PHP_URL_HOST) != '') {
|
if (@parse_url($url, PHP_URL_HOST) != '') {
|
||||||
$bits = parse_url($url);
|
$bits = parse_url($url);
|
||||||
$_SERVER['HTTP_HOST'] = $bits['host'];
|
$_SERVER['HTTP_HOST'] = $bits['host'];
|
||||||
// Implementing a custom absolute->relative code snippet as
|
$url = Director::makeRelative($url);
|
||||||
// Director::makeRelative() chokes on a url like http://localhost
|
|
||||||
// it will just return the original string, not /, or ''.
|
|
||||||
$url = (isset($bits['path']) ? $bits['path'] : '/') . (isset($bits['query']) ? '?'.$bits['query'] : '') . (isset($bits['fragment']) ? '#'.$bits['fragment'] : '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$urlWithQuerystring = $url;
|
$urlWithQuerystring = $url;
|
||||||
@ -487,6 +484,8 @@ class Director {
|
|||||||
if(preg_match('/^https?[^:]*:\/\//',$url)) {
|
if(preg_match('/^https?[^:]*:\/\//',$url)) {
|
||||||
$base1 = self::absoluteBaseURL();
|
$base1 = self::absoluteBaseURL();
|
||||||
if(substr($url,0,strlen($base1)) == $base1) return substr($url,strlen($base1));
|
if(substr($url,0,strlen($base1)) == $base1) return substr($url,strlen($base1));
|
||||||
|
// Convert http://www.mydomain.com/mysitedir to ''
|
||||||
|
else if(substr($base1,-1)=="/" && $url == substr($base1,0,-1)) return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// test for base folder, e.g. /var/www
|
// test for base folder, e.g. /var/www
|
||||||
|
Loading…
Reference in New Issue
Block a user