forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
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
WordPress 6.0 backports support for PR 2488 #3
Merged
hellofromtonya
merged 14 commits into
hellofromtonya:backport/block-patterns
from
ironprogrammer:pr/2488
Apr 7, 2022
Merged
WordPress 6.0 backports support for PR 2488 #3
hellofromtonya
merged 14 commits into
hellofromtonya:backport/block-patterns
from
ironprogrammer:pr/2488
Apr 7, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 tasks
hellofromtonya
approved these changes
Apr 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @ironprogrammer. LTGM 👍
hellofromtonya
pushed a commit
that referenced
this pull request
Oct 3, 2022
…_postid()`. As per the PHP manual: > If the `component` parameter is omitted, an associative array is returned. > If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned. Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values] In this case, `parse_url()` is called with `PHP_URL_HOST` as `$component`, which returns `null` if the URL only has a path. The return value of `parse_url()` was then passed to `str_replace()`, leading to a notice on PHP 8.1: {{{ str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} Adding validation for the return type value of `parse_url()` prevents that. This commit addresses a few errors in the test suite along the lines of: {{{ 5) Tests_Rewrite::test_url_to_postid_home_has_path str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated /var/www/src/wp-includes/rewrite.php:503 /var/www/tests/phpunit/tests/rewrite.php:271 /var/www/vendor/bin/phpunit:123 }}} Includes adding a dedicated unit test for a URL that only has a path. Follow-up to [41786], [51606], [51622], [51626], [51629], [51630], [52799]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54364 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
Feb 13, 2023
This brings more consistency with other screens and avoids a PHP warning in `get_plugin_page_hookname()`: {{{ preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} Props ipajen, jrf, SergeyBiryukov. Fixes #57578. git-svn-id: https://develop.svn.wordpress.org/trunk@55263 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
Feb 13, 2023
The `$credentials['user_login']` and `$credentials['user_password']` parameters are passed by reference to the `wp_authenticate` action, and are at that point [https://www.php.net/manual/en/language.references.pass.php#124383 created as null] if they don't exist in the array. This commit sets those values to an empty string, resolving two PHP 8.1 deprecation notices: * One from `preg_replace()` in `wp_strip_all_tags()` via `sanitize_user()` in `wp_authenticate()`: {{{ Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} * One from `trim()` in `wp_authenticate()` itself: {{{ Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated }}} Includes documenting the `$credentials` parameter using hash notation. Follow-up to [6643], [37697]. Props lenasterg, TobiasBg, ocean90, afragen, lkraav, SergeyBiryukov. Fixes #56850. git-svn-id: https://develop.svn.wordpress.org/trunk@55301 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
Mar 15, 2023
…assic themes. This brings more consistency with other screens and avoids a PHP warning in `get_plugin_page_hookname()`: {{{ preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} Follow-up to [13257], [13366], [55263]. Props nendeb55, costdev, SergeyBiryukov. Fixes #57918. git-svn-id: https://develop.svn.wordpress.org/trunk@55552 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
May 11, 2023
…assic themes. This brings more consistency with other screens and avoids a PHP warning in `get_plugin_page_hookname()`: {{{ preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} Follow-up to [13257], [13366], [55263]. Props nendeb55, costdev, SergeyBiryukov. Merges [55552] to the 6.2 branch. Fixes #57918. git-svn-id: https://develop.svn.wordpress.org/branches/6.2@55639 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
May 22, 2023
If the `$authordata` global is not set, `get_the_author()` returned `null`, causing a PHP 8.1 "null to non-nullable" deprecation notice in `ent2ncr()` hooked via `the_author` filter: {{{ str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} This commit updates `get_the_author()` to return an empty string if called before `$authordata` is set, bringing consistency with a few other similar functions which also return an empty string in this case: * `get_the_author_meta()` * `get_the_author_posts_link()` * `get_the_modified_author()` Follow-up to [695/tests], [2858], [11138], [12284], [20575], [34677], [44616], [53187]. Props Soean, jrf, sabernhardt, salvoaranzulla, antpb, ebai4, sajjad67, tijmensmit, SergeyBiryukov. Fixes #58157. git-svn-id: https://develop.svn.wordpress.org/trunk@55755 602fd350-edb4-49c9-b593-d223f7449a82
hellofromtonya
pushed a commit
that referenced
this pull request
Jul 5, 2023
…nitize_option()`. When saving the settings via the admin UI, the default value for any options not passed in the current `$_POST` request is set to `null` in `wp-admin/options.php`. Some options, e.g. `blog_public`, then rely on `null` being passed to `update_option()` to determine whether the value was changed or not. This commit resolves a PHP 8.1 deprecation notice when saving the `gmt_offset` option without any changes: {{{ Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated }}} Includes a similar fix for the `blog_charset` option. Follow-up to [4112], [4329], [5541], [21849]. Props adi3890, dhrupo, hrdelwar, hasanmisbah, oglekler, mukesh27, SergeyBiryukov. Fixes #57728. git-svn-id: https://develop.svn.wordpress.org/trunk@56132 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Amendments to @hellofromtonya's backports for PR 2488.
Trac ticket: https://core.trac.wordpress.org/ticket/55505
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.