Skip to content
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

Debugging the unit tests #2

Closed
wants to merge 20 commits into from

Conversation

anton-vlasenko
Copy link
Owner

Trac ticket:


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.

jorgefilipecosta and others added 17 commits January 27, 2024 00:05
For the new "All templates" UI to work properly we need the REST API to provide to additional fields original_source, and author_text.

Props ntsekouras, get_dave.
Fixes #60358.

git-svn-id: https://develop.svn.wordpress.org/trunk@57366 602fd350-edb4-49c9-b593-d223f7449a82
…`wp_print_inline_script_tag()` can take non-JS data.

Props vladimiraus.
Fixes #60331.


git-svn-id: https://develop.svn.wordpress.org/trunk@57367 602fd350-edb4-49c9-b593-d223f7449a82
This change ensures that the `sanitize_text_field` and `sanitize_textarea_field` filters are correctly invoked for the respective functions.

Follow-up to [38944].

Props pbearne, audrasjb.
Fixes #60357.

git-svn-id: https://develop.svn.wordpress.org/trunk@57368 602fd350-edb4-49c9-b593-d223f7449a82
…trol` and `WP_Customize_Nav_Menu_Location_Control`.

Follow-up to [20295], [32806].

Props nareshbheda, shailu25, sabernhardt, audrasjb.
Fixes #60324.





git-svn-id: https://develop.svn.wordpress.org/trunk@57369 602fd350-edb4-49c9-b593-d223f7449a82
Props upadalavipul, audrasjb, shailu25, viralsampat.
Fixes #59255.
See #59651.





git-svn-id: https://develop.svn.wordpress.org/trunk@57370 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up to [55289].

Props shailu25.
Fixes #60363.





git-svn-id: https://develop.svn.wordpress.org/trunk@57371 602fd350-edb4-49c9-b593-d223f7449a82
…ed_block_markup()`.

This aims to prevent type juggling causing incorrect results.

Follow-up to [57157].

Props jrf.
See #60279.

git-svn-id: https://develop.svn.wordpress.org/trunk@57372 602fd350-edb4-49c9-b593-d223f7449a82
@anton-vlasenko anton-vlasenko force-pushed the check/failing-jobs-packages-update-pr-65 branch from 4e7c9c6 to d24b38e Compare January 29, 2024 16:53
@anton-vlasenko
Copy link
Owner Author

This PR is obsolete.

anton-vlasenko pushed a commit that referenced this pull request Jun 21, 2024
When saving options from the Settings page, include the `'ping_sites'` option in the allowed "writing" options list only when the `'blog_public'` option is `'1'`.

Fixes a PHP 8.1 and above "null to non-nullable" deprecation notice in `sanitize_option()` ([https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php?annotate=blame#L4952 which happens when here] as part of [22255]):

{{{
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in .../wp-includes/formatting.php
}}}

**Explanation**

[https://developer.wordpress.org/apis/options/#writing Per the documentation], the `ping_sites` option requires the `'blog_public'` option to have a value of `'1'` and must be a `string` data type. `null` is not valid for this option.

The relationship between the 2 options shows itself in the `options-writing.php` code ([https://core.trac.wordpress.org/browser/tags/6.5.4/src/wp-admin/options-writing.php#L233 shown here] and in [4326]), as the `textarea#ping_sites` only renders when `'1' === get_option( 'blog_public' )`.

**What happens if `'blog_public'` is not `'1'`?**

The `'ping_sites'` option will not be a field on the page. Upon saving:

* HTTP POST (`$_POST`) does not include `'ping_sites'`. 
* Before this commit:
   * The [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/options.php#L333 option's value was set to] `null` before being passed to `update_option()`. 
   * `update_option()` invokes `sanitize_option()`.
   * A `null` value for the `'ping_sites'` case was passed to `explode()`, which threw a deprecation notice on PHP 8.1 and above.
* With this commit, the `'ping_sites'` option is no longer included in the allow list and thus will not be passed to `update_options()` > `sanitize_option()` > `explode()`.

Follow-up to [22255], [12825], [4326], [949].

Props kitchin, SergeyBiryukov, swissspidy, devmuhib, rajinsharwar, hellofromTonya.
Fixes #59818.

git-svn-id: https://develop.svn.wordpress.org/trunk@58425 602fd350-edb4-49c9-b593-d223f7449a82
anton-vlasenko pushed a commit that referenced this pull request Jun 21, 2024
…t_mime_types().

Fixes a PHP 8.1 and above "null to non-nullable" deprecation notice in `get_available_post_mime_types()`:

{{{
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ./wp-includes/post.php on line 3395
}}}

[https://developer.wordpress.org/reference/functions/get_available_post_mime_types/#return This function is documented] to:
* Return `An array of MIME types.`
* as an array of `string`s, i.e. `string[]`.

A `null` or empty element within the returned array is not a valid MIME type. If a `null` exists in the returned array, it is the root cause of PHP throwing the deprecation notice.

This commit removes the `null` and empty elements from the returned array of MIME types. It also adds a unit test.

Follow-up to [56623], [56452].

Props nosilver4u, jrf, ironprogrammer, antpb, antonvlasenko, rajinsharwar, hellofromTonya. 
Fixes #59195.

git-svn-id: https://develop.svn.wordpress.org/trunk@58437 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants