Extensions icon indicating copy to clipboard operation
Extensions copied to clipboard

[ImageProxy] PHP Deprecated: mb_convert_encoding()

Open math-GH opened this issue 1 year ago • 8 comments

PHP Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /..../extensions/xExtension-ImageProxy/extension.php on line 124

Image Proxy 0.7.1 FreshRSS 1.23.2-dev PHP 8.2

math-GH avatar Mar 19 '24 12:03 math-GH

Partially related to https://github.com/FreshRSS/Extensions/issues/202

Alkarex avatar Mar 19 '24 12:03 Alkarex

Still relevant. See update https://github.com/FreshRSS/Extensions/pull/269

Alkarex avatar Jan 11 '25 13:01 Alkarex

Ping @Frenzie if you can

Alkarex avatar May 02 '25 23:05 Alkarex

The notice is utter nonsense. Those are no alternatives.

Frenzie avatar May 03 '25 06:05 Frenzie

WOuld $content = htmlentities($content); solve this? It should be UTF-8 compatible...

Offerel avatar Jul 18 '25 18:07 Offerel

There are things you can play around with if you feel so inclined but I think it's a waste of time. Beware, it needs plenty of testing because subtle breakage is, well, subtle. ;-)

Starting with PHP 8.4 there's a proper HTML parser, so the issue's moot. Some rejiggering to switch to that is the way to go, but it's still a bit too early to do so. (Although I suppose it could be fine to say that you should stick with an older version if you're on <8.4.)

Frenzie avatar Jul 18 '25 18:07 Frenzie

It spams my log, thats all :-) But don't want to turn off deprecation warning, because i need it for my own things...

There will be so much water going down the Isar, before Debian has officially 8.4 :-( Anyway, i try to turn off this warnings for the directory/location block...

Update: Added error_reporting(E_ALL & ~E_DEPRECATED); for the time being...

Offerel avatar Jul 18 '25 19:07 Offerel

Added error_reporting(E_ALL & ~E_DEPRECATED); for the time being...

It should be possible to do something like this:

$oldReporting = error_reporting(error_reporting() & ~E_DEPRECATED);
mb_etc();
error_reporting($oldReporting);

Frenzie avatar Jul 18 '25 19:07 Frenzie