detect
This commit is contained in:
@@ -25,7 +25,7 @@ if (!@$apartado) {
|
|||||||
include "footer.php";
|
include "footer.php";
|
||||||
$resultInclude = ob_get_clean();
|
$resultInclude = ob_get_clean();
|
||||||
|
|
||||||
if (strpos($resultInclude,".php on line ") === false){
|
if (detect_error_on_code($resultInclude) === false){
|
||||||
echo $resultInclude;
|
echo $resultInclude;
|
||||||
}else{
|
}else{
|
||||||
echo error_html($resultInclude,true);
|
echo error_html($resultInclude,true);
|
||||||
@@ -47,7 +47,7 @@ if (!@$apartado) {
|
|||||||
|
|
||||||
$resultInclude = ob_get_clean();
|
$resultInclude = ob_get_clean();
|
||||||
|
|
||||||
if (strpos($resultInclude,".php on line ") === false){
|
if (detect_error_on_code($resultInclude) === false){
|
||||||
echo $resultInclude;
|
echo $resultInclude;
|
||||||
}else{
|
}else{
|
||||||
echo error_html($resultInclude);
|
echo error_html($resultInclude);
|
||||||
|
|||||||
@@ -298,6 +298,10 @@ function muestra_breadcrumb($record = array(), $previousLinks = array(),$class =
|
|||||||
echo '</nav>';
|
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) {
|
function error_html($error, $a404 = false) {
|
||||||
$result = '';
|
$result = '';
|
||||||
$icon = '
|
$icon = '
|
||||||
|
|||||||
2
slug.php
2
slug.php
@@ -392,7 +392,7 @@ addPlugins("pre_render",$resultInclude);
|
|||||||
if (class_exists("CocoDB") && isset(CocoDB::$force_redis_html) && CocoDB::$force_redis_html && @$hash){
|
if (class_exists("CocoDB") && isset(CocoDB::$force_redis_html) && CocoDB::$force_redis_html && @$hash){
|
||||||
CocoDB::cacheSet(@$hash,$resultInclude);
|
CocoDB::cacheSet(@$hash,$resultInclude);
|
||||||
}
|
}
|
||||||
if (strpos($resultInclude,".php on line ") === false){
|
if (detect_error_on_code($resultInclude) === false){
|
||||||
echo $resultInclude;
|
echo $resultInclude;
|
||||||
}else{
|
}else{
|
||||||
echo error_html($resultInclude);
|
echo error_html($resultInclude);
|
||||||
|
|||||||
Reference in New Issue
Block a user