Added check for NULL value in PHP internal error handling

Signed-off-by: Jonathan Straub <j.f.straub@gmx.de>
This commit is contained in:
Jonathan Straub
2020-11-01 16:43:32 +01:00
parent 274c196e42
commit 160f873672
+1 -1
View File
@@ -14,7 +14,7 @@ $piholeFTLConf = piholeFTLConfig();
// Handling of PHP internal errors
$last_error = error_get_last();
if($last_error["type"] === E_WARNING || $last_error["type"] === E_ERROR)
if($last_error && ($last_error["type"] === E_WARNING || $last_error["type"] === E_ERROR))
{
$error .= "There was a problem applying your settings.<br>Debugging information:<br>PHP error (".htmlspecialchars($last_error["type"])."): ".htmlspecialchars($last_error["message"])." in ".htmlspecialchars($last_error["file"]).":".htmlspecialchars($last_error["line"]);
}