mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR fixed relative URL resolver in Director::test()
MINOR improved documentation in static-main.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81749 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
48f200961e
commit
61ed3df367
@ -198,7 +198,10 @@ class Director {
|
||||
if (@parse_url($url, PHP_URL_HOST) != '') {
|
||||
$bits = parse_url($url);
|
||||
$_SERVER['HTTP_HOST'] = $bits['host'];
|
||||
$url = Director::makeRelative($url);
|
||||
// Implementing a custom absolute->relative code snippet as
|
||||
// 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;
|
||||
|
@ -8,6 +8,9 @@
|
||||
*
|
||||
* If you are using StaticPublisher+Subsites, set the following in _config.php:
|
||||
* FilesystemPublisher::$domain_based_caching = true;
|
||||
* If you are not using subsites, the host-map.php file will not exist (it is
|
||||
* automatically generated by the Subsites module) and the cache will default
|
||||
* to no subdirectory.
|
||||
*/
|
||||
|
||||
if (file_exists('../subsites/host-map.php')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user