simplepie / simplepie

A simple Atom/RSS parsing library for PHP.
http://simplepie.org/
1.55k stars 388 forks source link

Boolean passed to trim() throws fatal error in PHP8.2 and Simplepie 1.8 #852

Open git-marijus opened 1 year ago

git-marijus commented 1 year ago

This happens regularily when parsing certain feeds. Here is the trace:

PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in /vendor/simplepie/simplepie/src/Sanitize.php:319
Stack trace:
#0 /vendor/simplepie/simplepie/src/Sanitize.php(319): trim()
#1 /vendor/simplepie/simplepie/src/Sanitize.php(338): SimplePie\Sanitize->is_https_domain()
#2 /vendor/simplepie/simplepie/src/Sanitize.php(510): SimplePie\Sanitize->https_url()
#3 /vendor/simplepie/simplepie/src/Sanitize.php(413): SimplePie\Sanitize->replace_urls()
#4 /vendor/simplepie/simplepie/src/SimplePie.php(2307): SimplePie\Sanitize->sanitize()
#5 /vendor/simplepie/simplepie/src/Item.php(186): SimplePie\SimplePie->sanitize()
#6 /vendor/simplepie/simplepie/src/Item.php(352): SimplePie\Item->sanitize()
grimmdude commented 1 year ago

I'm seeing this issue too, but it appears to have been fixed in https://github.com/simplepie/simplepie/commit/58865afede2e88f533821baafabffedcbbc011ef

Will this be included in a release soon? Thanks

jtojnar commented 1 year ago

It should also have been fixed by https://github.com/simplepie/simplepie/pull/842 one-dot-eight branch. We could release 1.8.1 but we would need to check if there are some other regressions and then write release notes.

thE-iNviNciblE commented 1 year ago

it is fixed, the bug is gone.

Could someone release 1.9.0 or 1.8.1 since PHP 8.3 has now been released?

Everything works fine with PHP 8.3 and my round about 600+ feeds :-)

karptonite commented 8 months ago

We are also seeing this error, and as it is now fixed, it would be great if there could be a point release!

daviseford commented 5 months ago

I am encountered this error as well using 1.5. Upgrading to 1.8.0 solved my issue.