Skip to content
This repository
Browse code

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)
  • Loading branch information...
commit 63ad68a7d372fbccb2975568ea0e937725d6c0f2 1 parent d1bc721
Julian Seidenberg authored July 09, 2012
5  code/staticpublisher/FilesystemPublisher.php
@@ -191,10 +191,11 @@ function publishPages($urls) {
191 191
 			
192 192
 			Requirements::clear();
193 193
 			
194  
-			
195  
-			
196 194
 			singleton('DataObject')->flushCache();
197 195
 
  196
+			//skip any responses with a 404 status code. We don't want to turn those into statically cached pages
  197
+			if (!$response || $response->getStatusCode() == '404') continue;
  198
+
198 199
 			// Generate file content			
199 200
 			// PHP file caching will generate a simple script from a template
200 201
 			if($this->fileExtension == 'php') {

0 notes on commit 63ad68a

Please sign in to comment.
Something went wrong with that request. Please try again.