Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16735

Trying to access array offset on value of type bool

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3.4
    • 4.0.0-a1, 3.3.4-RC1
    • None
    • None

      I had this error when doing login with incorrect username

       

       

      This is caused in file  around line 140 with this code

      $sql = 'SELECT *
       FROM ' . USERS_TABLE . "
       WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
       $result = $this->db->sql_query($sql);
       $row = $this->db->sql_fetchrow($result);
       $this->db->sql_freeresult($result);

      $row is false, so when executing this like

      $show_captcha = $row !== false && ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) ||
       ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);

      is not possible to access to false['user_login_attempts']

       

      Caused by: https://github.com/phpbb/phpbb/pull/6155

            Marc Marc
            rubencm rubencm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: