Merge pull request #1448 from patricknelson/1447-errorpage-write-static-check

FIX for #1447 to ensure proper type-safe checking of file_put_contents() in ErrorPage->writeStaticPage()
This commit is contained in:
Damian Mooyman 2016-04-12 12:25:49 +12:00
commit 9c21bd1d70

View File

@ -250,7 +250,7 @@ class ErrorPage extends Page {
// if the page is published in a language other than default language,
// write a specific language version of the HTML page
$filePath = self::get_filepath_for_errorcode($this->ErrorCode, $this->Locale);
if (!file_put_contents($filePath, $errorContent)) {
if (file_put_contents($filePath, $errorContent) === false) {
$fileErrorText = _t(
'ErrorPage.ERRORFILEPROBLEM',
'Error opening file "{filename}" for writing. Please check file permissions.',