Menu

#788 PHP 8 warnings

Git
pending-works-for-me
nobody
None
5
2021-06-25
2021-02-25
No

Adminer 4.8.0
PHP 8.0.2

PHP Warning: Trying to access array offset on value of type bool in adminer.php on line 570
PHP Warning: Undefined variable $S in adminer.php on line 332

Discussion

  • Jakub Vrána

    Jakub Vrána - 2021-03-03
    • status: open --> pending-works-for-me
     
  • Jakub Vrána

    Jakub Vrána - 2021-03-03

    Please try the source code version from Git.

     
  • luigifab

    luigifab - 2021-03-04

    I have same problem. I can "fix" the problem with Firefox with this:
    - press CTRL+U to open source code in a new tab
    - press F5 in this new tab
    - close this new tab
    - press F5 in adminer tab

     
  • Lee Gimblett

    Lee Gimblett - 2021-03-16

    I have the same problem with PHP 8.0.3.

    Using the source code I can see that the warning:
    Warning: Trying to access array offset on value of type bool in /home/httpd/html/client/GDS/adminderSource/adminer/include/auth.inc.php on line 44

    Looking at the code warping the 'invalid' block of with a true test as below seems to solve the problem, but I am not sure if it makes sense or not.

    function check_invalid_login() {
        global $adminer;
        $invalids = unserialize(@file_get_contents(get_temp_dir() . "/adminer.invalid")); // @ - may not exist
    >>>>>  if($invalids) {
            $invalid = $invalids[$adminer->bruteForceKey()];
            $next_attempt = ($invalid[1] > 29 ? $invalid[0] - time() : 0); // allow 30 invalid attempts
            if ($next_attempt > 0) { //! do the same with permanent login
                auth_error(lang('Too many unsuccessful logins, try again in %d minute(s).', ceil($next_attempt / 60)));
            }
    >>>>>  }
    }
    
     

    Last edit: Lee Gimblett 2021-03-16
  • adrianbj

    adrianbj - 2021-06-25

    I'm running 4.8.1 and seeing PHP Warning: Undefined variable $dg in /adminer-4.8.1-mysql.php on line 868

     

Log in to post a comment.