From 52041d406f01387ab891e146e7b3b8b550217953 Mon Sep 17 00:00:00 2001 From: camer0n Date: Sun, 16 Mar 2025 12:48:18 -0700 Subject: [PATCH] Issue #5443 - PHP 8.4 fixes. --- class2.php | 13 ++++++++++--- e107_handlers/db_verify_class.php | 10 +++++++++- e107_plugins/news/news.php | 7 +++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/class2.php b/class2.php index 98c0458cb..aa951f605 100755 --- a/class2.php +++ b/class2.php @@ -1981,8 +1981,15 @@ class error_handler function __construct() { - $this->label = array(E_NOTICE => "Notice", E_WARNING => "Warning", E_DEPRECATED => "Deprecated", E_STRICT => "Strict"); - $this->color = array(E_NOTICE=> 'info', E_WARNING=>'warning', E_DEPRECATED => 'danger', E_STRICT => 'primary'); + $this->label = array(E_NOTICE => "Notice", E_WARNING => "Warning", E_DEPRECATED => "Deprecated"); + $this->color = array(E_NOTICE=> 'info', E_WARNING=>'warning', E_DEPRECATED => 'danger'); + + if (version_compare(PHP_VERSION, '8.4', '<')) + { + $this->label[E_STRICT] = "Strict"; + $this->color[E_STRICT] = 'primary'; + } + $this->docroot = e_ROOT; // dirname(realpath(__FILE__)).DIRECTORY_SEPARATOR; // This is initialized before the current debug level is known @@ -2003,7 +2010,7 @@ class error_handler if(!empty($_E107['cli'])) { - error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE); + error_reporting(E_ALL & ~E_NOTICE); return; } diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 8cdf3b1ed..3a9d3b747 100755 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -425,7 +425,10 @@ class db_verify } - + public function hasSyntaxIssue($sqlFileData): bool + { + return false; // TODO check syntax for errrors. + } /** * @param string $tbl table name without prefix. @@ -437,6 +440,11 @@ class db_verify */ public function prepareResults($tbl, $selection, $sqlData, $fileData) { + if($this->hasSyntaxIssue($fileData)) + { + return false; + } + // Check field and index data foreach(['field', 'index'] as $type) { diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index 5136eac74..28be89663 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -954,8 +954,11 @@ class news_front $gen = new convert; $sql->select("news_category", "*", "category_id='$category'"); - $row = $sql->fetch(); - extract($row); // still required for the table-render. :( + if($row = $sql->fetch()) + { + extract($row); // still required for the table-render. :( + } + } if ($this->action == 'all') // show archive of all news items using list-style template.