A1mDev / hlstatsx-community-edition

HLstatsX Community Edition - PHP 7,8 - and GeoIP2 supported
GNU General Public License v2.0
24 stars 10 forks source link

Fatal error: Uncaught TypeError #2

Closed bobl61 closed 1 year ago

bobl61 commented 1 year ago

Describe the bug Fatal error: Uncaught TypeError: Return value of getImage() must be an instance of mixed, array returned in C:\xampp\htdocs\ggturbo.ddns.net\includes\functions.php:470 Stack trace: #0 C:\xampp\htdocs\ggturbo.ddns.net\includes\functions.php(75): getImage('/flags/0') #1 C:\xampp\htdocs\ggturbo.ddns.net\includes\class_table.php(293): getFlag('0') #2 C:\xampp\htdocs\ggturbo.ddns.net\pages\players.php(403): Table->draw(Object(mysqli_result), '99', 95) #3 C:\xampp\htdocs\ggturbo.ddns.net\hlstats.php(225): include('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\ggturbo.ddns.net\includes\functions.php on line 470

Environment (Windows 11). Xampp - Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.16

Additional context This was a fresh install. I imported some logs (2022-2023) and deleted the updater folder. This error is the first thing that popped up when I visited the site.

bobl61 commented 1 year ago

Okay, so I did some research. Mixed is not compatible with PHP 7.4. I changed: function getImage($filename) : mixed to: function getImage($filename)

The error has gone away.

A1mDev commented 1 year ago

Ok, i will fix it later!