WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #50913, comment 16


Ignore:
Timestamp:
09/09/2020 11:32:46 AM (11 months ago)
Author:
andraganescu
Comment:

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-includex/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)`.
     1While 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)`.
    22
    33Changing the condition to `intval($qv['p']) < 0` fixes the wrong 404s.