From c019f22163816a47cfbee6d8320ed762c1df9a9b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 20 Aug 2012 15:22:13 +1200 Subject: [PATCH] Fix notice when ErrorPage tries to create static error pages and can't write --- code/model/ErrorPage.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/model/ErrorPage.php b/code/model/ErrorPage.php index 67548e82..16ac0ce6 100644 --- a/code/model/ErrorPage.php +++ b/code/model/ErrorPage.php @@ -88,6 +88,7 @@ class ErrorPage extends Page { // Ensure a static error page is created from latest error page content $response = Director::test(Director::makeRelative($pageNotFoundErrorPage->Link())); + $written = null; if($fh = fopen($pageNotFoundErrorPagePath, 'w')) { $written = fwrite($fh, $response->getBody()); fclose($fh); @@ -115,6 +116,7 @@ class ErrorPage extends Page { // Ensure a static error page is created from latest error page content $response = Director::test(Director::makeRelative($serverErrorPage->Link())); + $written = null; if($fh = fopen($serverErrorPagePath, 'w')) { $written = fwrite($fh, $response->getBody()); fclose($fh);