mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
Set the SubsiteID via the GET parameter when getting the html
This commit is contained in:
parent
02c2e66d69
commit
4f94e6962e
@ -226,9 +226,21 @@ class FilesystemPublisher extends StaticPublisher {
|
||||
|
||||
Requirements::clear();
|
||||
|
||||
if($url == "") $url = "/";
|
||||
if(Director::is_relative_url($url)) $url = Director::absoluteURL($url);
|
||||
$response = Director::test(str_replace('+', ' ', $url));
|
||||
if($url == "") {
|
||||
$url = "/";
|
||||
}
|
||||
if(Director::is_relative_url($url)) {
|
||||
$url = Director::absoluteURL($url);
|
||||
}
|
||||
|
||||
if(class_exists('Subsite') && Config::inst()->get('FilesystemPublisher', 'domain_based_caching')) {
|
||||
$urlParts = parse_url($url);
|
||||
$subSiteID = Subsite::getSubsiteIDForDomain($urlParts['host']);
|
||||
$url = $urlParts['path'];
|
||||
$response = Director::test(str_replace('+', ' ', $url.'?SubsiteID='.$subSiteID));
|
||||
} else {
|
||||
$response = Director::test(str_replace('+', ' ', $url));
|
||||
}
|
||||
|
||||
if (!$response) continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user