New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] PHP Fatal error: Uncaught TypeError: strspn(): Argument #1 ($string) must be of type string, null given in /framework/simplepie/src/Content/Type/Sniffer.php:153 #810
Comments
Thanks for reporting. Do you have the error message? |
Oh, never mind, it is in the title. Ugh, we should really have checked the codebase with PHPStan before releasing with Perhaps initializing the body to an empty string here will work as a stop gap: Line 62 in 7b0901c
This part of the code will be re-done with #774 so that will hopefully fix it properly. |
it's a PHP 8.2 thing, It should work with PHP Fatal error: Uncaught TypeError: strspn(): Argument #1 ($string) must be of type string, null given in /simplepie/src/Content/Type/Sniffer.php:153 |
Description
$ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20");
- simplepie/src/Content/Type/Sniffer.php:153$this->file->body is empty.
Steps to Reproduce
it's maybe a empty resource where the DOM HTML is empty.
Expected Behavior
skip invalid RSS-Source.
Actual Behavior
Fatal error cron job exits.
Possible Solutions
strlen() Check should work to avoid strspn() to crash.
Environment
Debian 10 with PHP 8.2
The text was updated successfully, but these errors were encountered: