[wp-trac] [WordPress Trac] #50913: PHP 8.0: various compatibility fixes
WordPress Trac
noreply at wordpress.org
Wed Sep 9 11:30:08 UTC 2020
#50913: PHP 8.0: various compatibility fixes
-------------------------------------------+-------------------------------
Reporter: jrf | Owner: SergeyBiryukov
Type: task (blessed) | Status: reviewing
Priority: normal | Milestone: 5.6
Component: General | Version:
Severity: normal | Resolution:
Keywords: php8 has-patch needs-dev-note | Focuses: coding-standards
-------------------------------------------+-------------------------------
Comment (by andraganescu):
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)`.
Changing the condition to `intval($qv['p']) < 0` fixes the wrong 404s.
Question: should I open a PR against this ticket for such findings as well
or is this ticket for more holistic fixes?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50913#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list