Error in langmgr.php on line 318 on php 8.x Error in langmgr.php on line 318 on php 8.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Error in langmgr.php on line 318 on php 8.x

Started by Asio Otus, May 06, 2022, 02:41:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Asio Otus

Error in langmgr.php on line 318 on php 8.x

Hello.
I updated the gallery version to 1.6.19, if the version of the php server is 8.x, then the language cannot be changed, if you lower the version to 7.4, then there are no problems with choosing the language.

There is an error in the Language Manager if the php server version is 8.x


QuoteFatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, bool given in ***/gallery/langmgr.php:318 Stack trace: #0 ***/gallery/langmgr.php(318): fclose(false) #1 {main} thrown in ***/gallery/langmgr.php on line 318

ron4mac

Can not reproduce the error. What exact version of PHP causes the error for you.

Asio Otus

Quote from: ron4mac on May 10, 2022, 12:22:55 AM
Can not reproduce the error. What exact version of PHP causes the error for you.

PHP Version 8.0.17, if I lower the version to 7.4.29, then there is no such error

ron4mac

#3
Using PHP 8.0.18, I have seen no error.  A normally configured PHP version should not generate an error on that line.  Perhaps there is a configuration issue with your version of PHP.  Or perhaps it is a bug in PHP 8.0.17 (but fixed in 8.0.18).

If you need some solution for your particular situation, you can try replacing line 318 in langmgr.php with:
if ($handle) @fclose($handle);