forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Some cleanup for 50052 #2
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
Open
azaozz
wants to merge
11
commits into
whyisjake:auto-updates-50052
Choose a base branch
from
azaozz:ticket-50052
base: auto-updates-50052
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
… `.alignwide` and `.alignfull` on Chrome vs Safari. Fixes the inconsistent margins for `alignwide` and `alignfull` classes used on Cover Block when it is the first block on a page. Props kthmd, utz119, nikhilbhansi. Fixes #49435. git-svn-id: https://develop.svn.wordpress.org/trunk@47820 602fd350-edb4-49c9-b593-d223f7449a82
- Remove `wp-autoupdates` from tranlsated strings. - Shorten some var names. - Use `add_query_arg()` for some URLs in the list tables. - Shorten couple of very long printf() HTML strings.
Also includes one core commit to Twenty Twenty... :) |
…manager.php`. Follow-up to [47819]. Props sorenbronsted. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47821 602fd350-edb4-49c9-b593-d223f7449a82
Props TimothyBJacobs (TimothyBlynJacobs)
and when no-js. Also some cleanup and CS fixes.
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
This fixes a `preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated` notice on PHP 8.1. The behavior for `null` and `string` input is covered by the existing `Tests_Functions::test_validate_file()` test. Effect: Errors down by 238, assertions up by 1920, failures down by 1. Props jrf, hellofromTonya, SergeyBiryukov. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51625 602fd350-edb4-49c9-b593-d223f7449a82
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
…` in `WP_Sitemaps_Provider::get_sitemap_url()`. The `WP_Sitemaps_Provider::get_sitemap_url()` method calls the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a `string`. A parameter being optional, however, does not automatically make it nullable. As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice. In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice. Changing the `null` to an empty string fixes this without a backward compatibility break. This change is already covered by tests as 14 of the existing tests failed on these function calls when running the tests on PHP 8.1. References: * [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()] * [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions] Follow-up to [48470]. Props jrf. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51652 602fd350-edb4-49c9-b593-d223f7449a82
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
… `wpdb::_real_escape()`. The PHP native `mysqli_real_escape_string()` function expects to be passed a string as the second parameter and this is not a nullable parameter. Passing `null` to it will result in a `mysqli_real_escape_string(): Passing null to parameter #2 ($string) of type string is deprecated` notice on PHP 8.1. Previously, an input type check was put in place to prevent fatal errors on PHP 8.0 when an array, object or resource was passed. Changeset [48980]. A `null` value was explicitly excluded from that check, even though a `null` value being passed would only ever result in an empty string anyway. This commit changes the previous input type check to also bow out early for `null` values and to automatically return an empty string for those. Refs: - https://www.php.net/manual/en/mysqli.real-escape-string.php - https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Follow-up to [48980]. Props jrf, hellofromTonya. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51799 602fd350-edb4-49c9-b593-d223f7449a82
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
…IncludesPlugin::test_get_plugin_files_folder()`. The `Tests_Admin_IncludesPlugin::_create_plugin()` expects the first parameter to be a text string to be written to a plugin file using `fwrite()`. Passing null causes a `fwrite(): Passing null to parameter #2 ($data) of type string is deprecated` notice. Ref: https://www.php.net/manual/en/function.fwrite Follow-up to [31002]. [41806]. Props jrf, hellofromTonya. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51800 602fd350-edb4-49c9-b593-d223f7449a82
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
… `_mb_substr()`. The `_mb_substr()` function expects a string for the `$str` parameter, but does not do input validation. This function contains a `preg_match_all()` which also expects a string type for the given subject (i.e. `$str`). Passing `null` to this parameter results in `preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated` notice on PHP 8.1. To maintain the same behaviour as before, a guard clause is added to bail out early when `$str` is passed as `null`. The outcome will, in that case, only ever be an empty string. Note: this does mean that the `_mb_substr()` function now has a subtle difference in behaviour compared to the PHP native `mb_substr()` function as the latter ''will'' throw the deprecation notice. The existing tests already cover this issue. Follow-up to [17621], [36017], [32364]. Props jrf, hellofromTonya. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51853 602fd350-edb4-49c9-b593-d223f7449a82
whyisjake
pushed a commit
that referenced
this pull request
Aug 24, 2023
…` in `get_core_checksums()` and `wp_version_check()`. The `get_core_checksums()` and `wp_version_check()` functions call the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a non-nullable `string`. A parameter being optional, however, does not automatically make it nullable. As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice. In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice. Changing the `null` to an empty string fixes this without a backward compatibility break. References: * [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()] * [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions] Follow-up to [18697], [25540]. Props bjorsch, kraftbj, hellofromTonya, jrf. See #54229. git-svn-id: https://develop.svn.wordpress.org/trunk@52019 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.
wp-autoupdates
from tranlsated strings.add_query_arg()
for some URLs in the list tables.