]> git.joonet.de Git - adminer.git/commitdiff
PHP 8.3 error suppression
authorSneda8 <85223444+Sneda8@users.noreply.github.com>
Sun, 17 Dec 2023 00:36:25 +0000 (01:36 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:36 +0000 (11:16 +0100)
PHP 8.3 has shortened the array access on null error message to "Trying to access array offset on null". This commit changes the regular expression used to circumvent errors.

adminer/include/bootstrap.inc.php
adminer/include/version.inc.php
changes.txt
compile.php

index 45f81367025ba00db3aad6bd6b8e45f40d38402f..cc5f20010bbde396eaaafadf4c38dddbf077dad0 100644 (file)
@@ -1,11 +1,5 @@
 <?php
-function adminer_errors($errno, $errstr) {
-       return !!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~', $errstr);
-}
-
-error_reporting(6135); // errors and warnings
-set_error_handler('adminer_errors', E_WARNING);
-
+include "../adminer/include/version.inc.php";
 include "../adminer/include/coverage.inc.php";
 
 // disable filter.default
@@ -108,7 +102,6 @@ define("ME", preg_replace('~\?.*~', '', relative_uri()) . '?'
        . (DB != "" ? 'db=' . urlencode(DB) . '&' . (isset($_GET["ns"]) ? "ns=" . urlencode($_GET["ns"]) . "&" : "") : '')
 );
 
-include "../adminer/include/version.inc.php";
 include "../adminer/include/design.inc.php";
 include "../adminer/include/xxtea.inc.php";
 include "../adminer/include/auth.inc.php";
index 4cbf54009aeb8654dde65c94420a5ae70479ad39..a156a75c3c588064ffae1bf93133f832aaeb0510 100644 (file)
@@ -1,2 +1,9 @@
 <?php
 $VERSION = "4.9.1-dev";
+
+function adminer_errors($errno, $errstr) {
+       return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined array key)~', $errstr);
+}
+
+error_reporting(6135); // errors and warnings
+set_error_handler('adminer_errors', E_WARNING);
index 5c297892c7e404ac4543318622887e554ed73b11..8bceca72d51307e01eb066dde31120a553d60b0a 100644 (file)
@@ -1,3 +1,6 @@
+Adminer 4.9.1-dev:
+Support PHP 8.3
+
 Adminer 4.9.0:
 Validate connection to server in HTTP based drivers
 Elasticsearch 5: Make unusable driver usable again, move it to plugins
index 73f2edb54a645d8bcbcfc8d966279a578760b630..a9716f2ac2008809e936b25c75732ea8dda7ff43 100755 (executable)
@@ -1,11 +1,5 @@
 #!/usr/bin/env php
 <?php
-function adminer_errors($errno, $errstr) {
-       return !!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~', $errstr);
-}
-
-error_reporting(6135); // errors and warnings
-set_error_handler('adminer_errors', E_WARNING);
 include dirname(__FILE__) . "/adminer/include/version.inc.php";
 include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";