Skip to content
This repository
Browse code

Fix notice when ErrorPage tries to create static error pages and can'…

…t write
  • Loading branch information...
commit c019f22163816a47cfbee6d8320ed762c1df9a9b 1 parent 2923e55
Sean Harvey authored August 20, 2012

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  code/model/ErrorPage.php
2  code/model/ErrorPage.php
@@ -88,6 +88,7 @@ function requireDefaultRecords() {
88 88
 	
89 89
 				// Ensure a static error page is created from latest error page content
90 90
 				$response = Director::test(Director::makeRelative($pageNotFoundErrorPage->Link()));
  91
+				$written = null;
91 92
 				if($fh = fopen($pageNotFoundErrorPagePath, 'w')) {
92 93
 					$written = fwrite($fh, $response->getBody());
93 94
 					fclose($fh);
@@ -115,6 +116,7 @@ function requireDefaultRecords() {
115 116
 	
116 117
 				// Ensure a static error page is created from latest error page content
117 118
 				$response = Director::test(Director::makeRelative($serverErrorPage->Link()));
  119
+				$written = null;
118 120
 				if($fh = fopen($serverErrorPagePath, 'w')) {
119 121
 					$written = fwrite($fh, $response->getBody());
120 122
 					fclose($fh);

0 notes on commit c019f22

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