e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

Fatal error in top.php - PHP 8 - wrong parameter #4967

Closed Jimmi08 closed 1 year ago

Jimmi08 commented 1 year ago

Bug Description

Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in ***\e107_handlers\e_ranks_class.php:223 Stack trace: #0 ***\top.php(182): e_ranks->getRanks(Array, true) #1 {main} thrown in ***\e107_handlers\e_ranks_class.php on line 223

How to Reproduce

Steps to reproduce the behavior:

  1. Go to top.php with users and ranks and forum

Reason: in top.php:

//$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
$ldata = $rank->getRanks($row, (USER && $forum->isModerator(USERID)));

Ranks handler:

    /**
     * @param $userId
     * @param $moderator
     * @return array|mixed
     */
    function getRanks($userId, $moderator = false)