This commit is contained in:
Jordan
2026-04-15 19:56:57 +01:00
parent 6cd37bd2c1
commit 4f78c9276e
3 changed files with 7 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ if (!@$apartado) {
include "footer.php";
$resultInclude = ob_get_clean();
if (strpos($resultInclude,".php on line ") === false){
if (detect_error_on_code($resultInclude) === false){
echo $resultInclude;
}else{
echo error_html($resultInclude,true);
@@ -47,7 +47,7 @@ if (!@$apartado) {
$resultInclude = ob_get_clean();
if (strpos($resultInclude,".php on line ") === false){
if (detect_error_on_code($resultInclude) === false){
echo $resultInclude;
}else{
echo error_html($resultInclude);

View File

@@ -298,6 +298,10 @@ function muestra_breadcrumb($record = array(), $previousLinks = array(),$class =
echo '</nav>';
}
function detect_error_on_code($code) {
preg_match_all('/\b(Fatal error|Parse error|Warning|Notice):.*?\b/i', $code, $matches);
return @$matches[0];
}
function error_html($error, $a404 = false) {
$result = '';
$icon = '

View File

@@ -392,7 +392,7 @@ addPlugins("pre_render",$resultInclude);
if (class_exists("CocoDB") && isset(CocoDB::$force_redis_html) && CocoDB::$force_redis_html && @$hash){
CocoDB::cacheSet(@$hash,$resultInclude);
}
if (strpos($resultInclude,".php on line ") === false){
if (detect_error_on_code($resultInclude) === false){
echo $resultInclude;
}else{
echo error_html($resultInclude);