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

This commit is contained in:
Sean Harvey 2012-08-20 15:22:13 +12:00
parent 2923e55c71
commit c019f22163

View File

@ -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);