-
-
Notifications
You must be signed in to change notification settings - Fork 782
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
Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given #3401
Closed
Comments
Hello, |
This feed uses an empty length, which crashes with PHP 8+ <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> Fix coming |
Alkarex
added a commit
to Alkarex/FreshRSS
that referenced
this issue
Jan 29, 2021
#fix FreshRSS#3401 Use `!empty` instead to properly handle falsy values such as empty string, 0, false, null. While 0 would be grammatically fine, it does not make sense for a media length or height, or width or framerate or bitrate
Fix ready #3404 |
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this issue
Jan 29, 2021
#fix FreshRSS/FreshRSS#3401 (crash with PHP 8+) Use `!empty` instead of `isset()` to properly handle falsy values such as empty string, 0, false, null. While 0 would be grammatically fine in some cases, it does not make sense for a media length or height, or width or framerate or bitrate. Example with feed http://podcast.hr2.de/derTag/podcast.xml ```xml <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> ``` `isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+: ``` Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in ./SimplePie/SimplePie/Item.php:2871 ``` `!empty()` fixes the problem.
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this issue
Jan 30, 2021
`ceil()` crashes in PHP8+ in case of invalid input such as empty string. `intval()` fixes the problem with almost identical beahviour than `ceil()` in PHP7- (except for flotting point values) #fix FreshRSS/FreshRSS#3401 (crash with PHP 8+) Example with feed http://podcast.hr2.de/derTag/podcast.xml ```xml <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> ``` `isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+: ``` Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in ./SimplePie/SimplePie/Item.php:2871 ```
mblaney
pushed a commit
to simplepie/simplepie
that referenced
this issue
Jan 31, 2021
`ceil()` crashes in PHP8+ in case of invalid input such as empty string. `intval()` fixes the problem with almost identical beahviour than `ceil()` in PHP7- (except for flotting point values) #fix FreshRSS/FreshRSS#3401 (crash with PHP 8+) Example with feed http://podcast.hr2.de/derTag/podcast.xml ```xml <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> ``` `isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+: ``` Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in ./SimplePie/SimplePie/Item.php:2871 ```
Alkarex
added a commit
that referenced
this issue
Jan 31, 2021
#fix #3401 (crash with PHP 8+) `ceil()` crashes in PHP8+ in case of invalid input such as empty string. `intval()` fixes the problem with almost identical behaviour than `ceil()` in PHP7- (except for floating point values) #fix #3401 (crash with PHP 8+) Example with feed http://podcast.hr2.de/derTag/podcast.xml ```xml <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> ``` `isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+: ``` Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in ./SimplePie/SimplePie/Item.php:2871 ``` Upstream patch simplepie/simplepie#670
Seems to be fixed after updating! 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm on 1.17.1-dev, docker:
The text was updated successfully, but these errors were encountered: