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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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);