[wp-trac] [WordPress Trac] #53635: PHP 8.1: various compatibility fixes
WordPress Trac
noreply at wordpress.org
Mon Sep 20 18:21:46 UTC 2021
#53635: PHP 8.1: various compatibility fixes
-------------------------------------------------+-------------------------
Reporter: SergeyBiryukov | Owner:
| hellofromTonya
Type: task (blessed) | Status: accepted
Priority: normal | Milestone: 5.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: php81 has-patch has-unit-tests | Focuses: coding-
commit | standards
-------------------------------------------------+-------------------------
Comment (by hellofromTonya):
In [changeset:"51829" 51829]:
{{{
#!CommitTicketReference repository="" revision="51829"
Login and Registration: Fix "passing null to non-nullable" deprecation for
`authorize_application` error message.
If there is no URL query in the `$_GET['redirect_to'], `wp_parse_url()`
will return `null`. Passing `null` to `parse_str()` results in a PHP 8.1
deprecation notice
{{{
Deprecated: parse_str(): Passing null to parameter #1 ($string) of type
string is deprecated
}}}
This commit:
- Fixes the deprecation notice.
- Skips doing the `parse_str()` when there's no URL query.
- Provides a micro-optimization performance boost.
Follow-up to [49109].
Props jrf, hellofromTonya, BinaryKitten.
See #53635.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53635#comment:115>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list