瀏覽代碼

Merge pull request #106 from niol/main

PHP 8.3 error suppression
Lionel 1 年之前
父節點
當前提交
c93adaabea
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      adminer/include/bootstrap.inc.php
  2. 2 1
      compile.php

+ 1 - 1
adminer/include/bootstrap.inc.php

@@ -1,6 +1,6 @@
 <?php
 function adminer_errors($errno, $errstr) {
-	return !!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~', $errstr);
+	return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined array key)~', $errstr);
 }
 
 error_reporting(6135); // errors and warnings

+ 2 - 1
compile.php

@@ -251,7 +251,8 @@ function php_shrink($input) {
 		if (!is_array($token)) {
 			$token = array(0, $token);
 		}
-		if ($tokens[$i+2][0] === T_CLOSE_TAG && $tokens[$i+3][0] === T_INLINE_HTML && $tokens[$i+4][0] === T_OPEN_TAG
+		if (!is_null($tokens[$i+2])
+			&& $tokens[$i+2][0] === T_CLOSE_TAG && $tokens[$i+3][0] === T_INLINE_HTML && $tokens[$i+4][0] === T_OPEN_TAG
 			&& strlen(add_apo_slashes($tokens[$i+3][1])) < strlen($tokens[$i+3][1]) + 3
 		) {
 			$tokens[$i+2] = array(T_ECHO, 'echo');