Merge pull request #762 from pi-hole/feature/PHP_error_display

Settings page: Display PHP errors
This commit is contained in:
Mark Drobnak
2018-06-07 21:43:38 -04:00
committed by GitHub
2 changed files with 8 additions and 6 deletions

View File

@@ -209,16 +209,11 @@ $(".nav-tabs a").on("shown.bs.tab", function (e) {
window.scrollTo(0, 0);
});
// Auto dismissal for info and error notifications
// Auto dismissal for info notifications
$(document).ready(function(){
var alInfo = $("#alInfo");
var alError = $("#alError");
if(alInfo.length)
{
alInfo.delay(3000).fadeOut(2000, function() { alInfo.hide(); });
}
if(alError.length)
{
alError.delay(3000).fadeOut(2000, function() { alError.hide(); });
}
});

View File

@@ -19,6 +19,13 @@ else
$piholeFTLConf = array();
}
// Handling of PHP internal errors
$last_error = error_get_last();
if($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"]);
}
?>
<style type="text/css">
.tooltip-inner {