BUGFIX: fixing an edge-case bug where a 404-page would get statically published and overwrite the homepage of the site (this would sometimes happen when a RedirectorPage was set to an external URL and still referenced an internal page ID)

This commit is contained in:
Julian Seidenberg 2012-07-09 13:24:00 +12:00
parent 4abe136db5
commit 838ac97177

View File

@ -186,11 +186,12 @@ class FilesystemPublisher extends StaticPublisher {
$response = Director::test(str_replace('+', ' ', $url));
Requirements::clear();
singleton('DataObject')->flushCache();
//skip any responses with a 404 status code. We don't want to turn those into statically cached pages
if (!$response || $response->getStatusCode() == '404') continue;
// Generate file content
// PHP file caching will generate a simple script from a template
if($this->fileExtension == 'php') {