Changes between Initial Version and Version 1 of Ticket #50913, comment 16
- Timestamp:
- 09/09/2020 11:32:46 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #50913, comment 16
initial v1 1 While testing on PHP 8 I found that any page (home or archive) will return 404 as if there were no posts available. The problem appears to be in `wp-include x/class-wp-query.php` at line `762`, where the new [https://wiki.php.net/rfc/string_to_number_comparison Saner string to number comparisons] makes it so that `"" < 0 === true`, so `$qv['p'] < 0` is `true` since the default for `$qv['p']` is `string(0)`.1 While testing on PHP 8 I found that any page (home or archive) will return 404 as if there were no posts available. The problem appears to be in `wp-includes/class-wp-query.php` at line `762`, where the new [https://wiki.php.net/rfc/string_to_number_comparison Saner string to number comparisons] makes it so that `"" < 0 === true`, so `$qv['p'] < 0` is `true` since the default for `$qv['p']` is `string(0)`. 2 2 3 3 Changing the condition to `intval($qv['p']) < 0` fixes the wrong 404s.