49951 Commits

Author SHA1 Message Date
Tonya Mork
fa417fc14a Editor: Fix bumped specificity for layout styles in non-iframed editor.
Fixes a regression introduced in [58241] which inadvertently bumped the specificity in a non-iframed editor for `.editor-styles-wrapper .is-layout-flow > *` from (0,1,0) to (0,2,0). This fix restores theme.json spacing rules taking precedence over the implicit spacing rules in a non-iframed editor.

**The What**

When the block editor is not iframed (which can happen when Custom Fields are active, or blocks that use and older `apiVersion` are present), style rules are processed using post css to append the `.editor-styles-wrapper` class name. This has the effect of scoping the the style rules to ensure they don't affect the editor chrome or admin.

With [58241], one of the rules was changed to `.is-layout-flow > *`. In a iframed editor, the specificity of this rule is okay (0,1,0), but in a non-iframed editor it becomes `.editor-styles-wrapper .is-layout-flow > *`, a specificity of (0,2,0). Comparing this to before [58241], the same rule was `.editor-styles-wrapper :where(body .is-layout-flow) > *` (specificity 0,1,0). This is a regression in specificity that has caused some issues. Notably themes can no longer properly override the spacing for blocks using theme.json and have the results correctly shown in the non-iframed editor.

**The How**

This changeset modifies the selector to `:root :where(.is-layout-flow) > *` (still specificity 0,1,0). `transformStyles` handles 'root' selectors a little differently, it'll instead replace the `:root` part so it becomes `.editor-styles-wrapper where(.is-layout-flow) > *` (keeping the specificity at 0,1,0).

The other layout selector that this affects is the `:first-child` `:last-child` selectors that are responsible for resetting margin at the start and end of a block list. They traditionally have a 0,2,0 specificity so that they can override both the above rule and any rules in the theme.json. Those selectors are also maintained at 0,2,0 with this change, they become something like `:root :where(.is-layout-flow) > :first-child`.

**References:**
* PHP changes from [https://github.com/WordPress/gutenberg/pull/64076 Gutenberg PR 64076].

Follow-up to [58241], [58228], [55956], [54162].

Props talldanwp, aaronrobertshaw, andrewserong, markhowellsmead, ramonopoly, hellofromTonya.
Fixes #61829.

git-svn-id: https://develop.svn.wordpress.org/trunk@58890 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-13 17:43:18 +00:00
Sergey Biryukov
3476790c2e Coding Standards: Replace an empty foreach loop in wp_replace_in_html_tags().
This aims to clarify the intention of the code and improve readability.

Follow-up to [33359].

Props jrf, TobiasBg, mi5t4n, dhruvang21, mayura8991, nadimcse, Presskopp, SergeyBiryukov.
Fixes #61860.

git-svn-id: https://develop.svn.wordpress.org/trunk@58889 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-13 16:27:32 +00:00
Sergey Biryukov
5f8f3789d1 Coding Standards: Bring some consistency to setting up comment moderation links.
Follow-up to [7082], [7175], [9103], [10102], [11749], [12008], [12286], [32516].

Props kebbet.
See #61607.

git-svn-id: https://develop.svn.wordpress.org/trunk@58888 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-12 21:26:27 +00:00
Tammie Lister
802e069d05 Twenty Twelve: Fixes navigation block submenus being cut off.
The navigation block submenus were being cut off. This is the simpler method proposed in patches.

Props poena, sabernhardt.
Fixes #61672.


git-svn-id: https://develop.svn.wordpress.org/trunk@58887 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-12 15:17:27 +00:00
Tammie Lister
ac7045cedf Twenty Seventeen: Fixes Pullquote block text color not changing on front.
The Pullquote block text color was not changing on the front. This overrides the inlined styles.

Props iamjaydip, laurelfulford, sabernhardt.
Fixes #46080.


git-svn-id: https://develop.svn.wordpress.org/trunk@58886 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-12 13:42:09 +00:00
Tammie Lister
ddc5d6aba4 Twenty Twelve: Fixes Button block outline style having wrong text color on front.
The Button block has a different text color on the front to the editor when you apply text color. This resolves it without changing other styles.

Props pitamdey, ugyensupport, sabernhardt.
Fixes #61846.


git-svn-id: https://develop.svn.wordpress.org/trunk@58885 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-12 10:54:43 +00:00
Peter Wilson
ac5fdb4660 Site Health: Check if directories exist before checking size.
Prevents the Site Health Debug tab from stalling when reporting directory sizes if the directory does not exist.

Props clorith, aristath, narenin, kowsar89, hellofromTonya, ironprogrammer, shailu25.
Fixes #61638.


git-svn-id: https://develop.svn.wordpress.org/trunk@58884 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-12 04:52:55 +00:00
Sergey Biryukov
6cfec3b825 Docs: Switch canonical location for the comment_row_actions filter.
This aims to bring consistency with the other `*_row_actions` filters.

Follow-up to [6705], [8217], [9103], [15491], [26138], [27669].

See #61608.

git-svn-id: https://develop.svn.wordpress.org/trunk@58883 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-11 21:08:06 +00:00
Tammie Lister
0cbfd5b22c Twenty Twelve: Fixes Code block font family difference in editors.
The Code block font family was different in the front-end and the editor. This resolves the overruling in the iframe editor.

Props pitamdey, sabernhardt.
Fixes #61808.


git-svn-id: https://develop.svn.wordpress.org/trunk@58882 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-11 14:24:10 +00:00
Tammie Lister
d80e18cc2d Twenty Nineteen: Fixes translatable strings with HTML code not appearing.
Only the translatable part not HTML, should appear for translators to avoid issues. This resolves one string that was not appearing. This only fixed for one theme although discussion on the ticket was for multiples. Other tickets should be open for those if desireable.

Props Presskopp, SergeyBiryukov, pratikkry, pento, mukesh27, laurelfulford, kjellr, desrosj, sabernhardt.
Fixes #45473.


git-svn-id: https://develop.svn.wordpress.org/trunk@58881 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-11 09:43:14 +00:00
Peter Wilson
faf75b7925 External Libraries: Update the Underscore.js library to version 1.13.7.
This updates the Underscore library from version 1.13.6 to 1.13.7. This is a minor bug fix release.

The full list of changes can be found in the Underscore.js change log: https://underscorejs.org/#changelog.

Props hbhalodia, aristath, desrosj, mcrisp1972.
Fixes #61836.



git-svn-id: https://develop.svn.wordpress.org/trunk@58880 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-10 23:55:22 +00:00
Sergey Biryukov
76256bd975 Administration: Replace contracted verb forms for better consistency.
Follow-up to [14951], [37221], [52979], [52978], [55977].

Props kebbet, sabernhardt.
Fixes #58639.

git-svn-id: https://develop.svn.wordpress.org/trunk@58879 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-10 23:00:19 +00:00
Peter Wilson
e0ee668d0d Code Quality: Clarify variable names in dependency classes.
Renames several variables in the `WP_Scripts` and `WP_Styles` classes to clarify their purpose for developers reading the code.

Props peterwilsoncc, sergeybiryukov.
See #61607.



git-svn-id: https://develop.svn.wordpress.org/trunk@58878 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-10 22:58:07 +00:00
Dennis Snell
29348dfc9a HTML API: Remove completed TODO comments.
This patch removes TODO comments indicating the need to verify certain behaviors and algorithms. Those verifications have taken place and the comments are no longer needed.

Developed in https://github.com/wordpress/wordpress-develop/pull/7174
Discussed in https://core.trac.wordpress.org/ticket/61646

Follow-up to [58867], [58870].

Props jonsurrell.
See #64646.


git-svn-id: https://develop.svn.wordpress.org/trunk@58877 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-10 04:58:16 +00:00
Felix Arntz
433397998a Build/Test Tools: Avoid using wp_delete_user() in PHPUnit tests unless explicitly acknowledging or ignoring Multisite.
`wp_delete_user()` does not actually delete the entire user when using WordPress Multisite. Therefore tests should typically use the test helper method to fully delete the user, unless explicitly ignoring Multisite or testing the `wp_delete_user()` function while taking Multisite behavior into account.

Fixes #61851.


git-svn-id: https://develop.svn.wordpress.org/trunk@58876 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-09 18:29:47 +00:00
Felix Arntz
defaa76195 Comments: Add optional $context parameter to get_edit_comment_link() to get the URL without HTML entities.
This brings the function in line with the similar `get_edit_post_link()` parameter. The 'get_edit_comment_link' filter now additionally receives the `$comment_id` and `$context` as parameters.

Additionally, as a minor enhancement, the capability check is now more defensive, as it will no longer cause an error if the given comment ID is invalid.

As part of the changeset, comprehensive test coverage for the `get_edit_comment_link()` including the new behavior is added.

Props deepakrohilla.
Fixes #61727.


git-svn-id: https://develop.svn.wordpress.org/trunk@58875 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-09 17:59:41 +00:00
Sergey Biryukov
9f09c574c0 Docs: Remove unsupported values in plugins_api() DocBlocks.
The `group` field and the `hot_categories` action were never actually implemented on the WordPress.org side.

Follow-up to [34596], [meta3227].

Props lopo, milana_cap.
See #55645.

git-svn-id: https://develop.svn.wordpress.org/trunk@58873 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-09 00:16:33 +00:00
Jonathan Desrosiers
ec58d38eef External Libraries: Update the Backbone.js library to version 1.6.0.
This updates the `backbone` library from version `1.5.0` to `1.6.0`. This is a minor bug fix release.

The full list of changes can be found in the Backbone.js change log: https://backbonejs.org/#changelog.

Props manooweb mardroid.
Fixes #60512.

git-svn-id: https://develop.svn.wordpress.org/trunk@58872 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 19:35:24 +00:00
Dennis Snell
7ceb8394c7 HTML API: Test and fix SVG script handling.
When support was added for foreign content, an ambiguity in the HTML specification led to code that followed the wrong path when encountering a self-closing SCRIPT element in the SVG namespace. Further, a fallthrough was discovered during manual testing.

This patch adds a new test to assert the proper behaviors and fixes these issues. In the case of the SCRIPT element, the outcome was the same with the wrong code path, making the defect benign. In the case of the fallthrough, the wrong behavior would occur.

The updates in this patch also resolves a todo relating to the spec ambiguity.

Developed in https://github.com/wordpress/wordpress-develop/pull/7164
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58868].

Props: dmsnell, jonsurrell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58871 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 17:02:46 +00:00
Dennis Snell
b9014d69e3 HTML API: expect_closer() should report false for self-closing foreign elements.
Previously, `WP_HTML_Processor::expects_closer()` would report `true` for self-closing foreign elements when called without supplying a node in question, but it should have been reporting `true` just as it does for HTML elements.

This patch adds a test case demonstrating the issue and a bugfix.

The `html5lib` test runner was relying on the incorrect behavior, accidentally working. This is also corrected and the `html5lib` test now relies on the correct behavior of `expects_closer()`.

Developed in https://github.com/wordpress/wordpress-develop/pull/7162
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58868].

Props: dmsnell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58870 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 16:13:25 +00:00
Dennis Snell
fe9aa7c48d HTML API: Add support for SVG and MathML (Foreign content) (remove file)
As part of work to add more spec support to the HTML API, this patch adds support for SVG and MathML elements, or more generally, "foreign content."

The rules in foreign content are a mix of XML and HTML parsing rules and introduce additional complexity into the processor, but is important in order to avoid getting lost when inside these elements.

This patch follows the first by deleting the empty files, which were mistakenly left in during the initial merge.

Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576

Follow-up to [58867].

Props: dmsnell, jonsurrell, westonruter.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58868 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 07:31:15 +00:00
Dennis Snell
de084d7d0e HTML API: Add support for SVG and MathML (Foreign content)
As part of work to add more spec support to the HTML API, this patch adds
support for SVG and MathML elements, or more generally, "foreign content."

The rules in foreign content are a mix of XML and HTML parsing rules and
introduce additional complexity into the processor, but is important in
order to avoid getting lost when inside these elements.

Developed in https://github.com/wordpress/wordpress-develop/pull/6006
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell, westonruter.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58867 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 07:23:53 +00:00
Dennis Snell
4026237dad HTML API: Ensure that get_modifiable_text() reads enqueued updates.
When `set_modifiable_text()` was added to the Tag Processor, it was considered that the same information could be queried after setting its value and before proceeding to the next token, but unfortunately overlooked that if the starting modifiable text length was zero, then the read in `get_modifiable_text()` would ignore enqueued updates.

In this patch, `get_modifiable_text()` will read any enqueued values before reading from the input HTML document to ensure consistency.

Follow-up to [58829].
Props dmsnell, jonsurrell, ramonopoly.
Fixes #61617.


git-svn-id: https://develop.svn.wordpress.org/trunk@58866 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 04:24:03 +00:00
Sergey Biryukov
f9af91cfa5 Docs: Correct alignment for rest_insert_attachment action DocBlock.
Follow-up to [39348].

Props krupalpanchal.
See #61608.

git-svn-id: https://develop.svn.wordpress.org/trunk@58865 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-08 02:25:32 +00:00
Tonya Mork
20cb3098c8 Docs: Remove bugfix since annotations from WP_Theme_JSON::get_block_nodes().
Removes the `@since` bugfix annotations from `WP_Theme_JSON::get_block_nodes()` docblock. Bugfixes are not annotated in docblocks.

Follow-up to [58856].
See #61704.

git-svn-id: https://develop.svn.wordpress.org/trunk@58864 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-07 19:56:43 +00:00
Jonathan Desrosiers
2ca1069a83 External Libraries: Update the whatwg-fetch polyfill library.
This updates the `whatwg-fetch` library from version `3.6.17` to `3.6.20`, the latest current version.

This library is included and registered within WordPress as the `wp-polyfill-fetch` script but is no longer used by WordPress itself. Updates are provided as a courtesy, and all projects using this polyfill should reevaluate usage.

Props manooweb.
Fixes #60514.

git-svn-id: https://develop.svn.wordpress.org/trunk@58860 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-07 15:50:33 +00:00
Dennis Snell
9928cd6bcb HTML API: Use full parser in html5lib tests.
Previously the `html5lib` tests have only run in the fragment parser mode,
assuming IN BODY context. This limited the number of tests which could run
and was a result of the HTML Processor only supporting the IN BODY fragment
parser. In [58836], however, a full parser was added to the HTML Processor.

In this patch the full parser is utilized in order to run more of the
previously-skipped tests, asserting more behaviors in the HTML parsing.

Developed in https://github.com/wordpress/wordpress-develop/pull/7117
Discussed in https://core.trac.wordpress.org/ticket/61646

Props: dmsnell, jonsurrell.
See #61646.


git-svn-id: https://develop.svn.wordpress.org/trunk@58859 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-06 22:05:47 +00:00
Dennis Snell
534b830b37 HTML API: Truncated funky comments should cause the Tag Processor to pause.
A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in https://github.com/wordpress/wordpress-develop/pull/7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.


git-svn-id: https://develop.svn.wordpress.org/trunk@58858 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-06 20:41:58 +00:00
Sergey Biryukov
96c2a46863 Site Health: Clarify the description for max_file_uploads in Site Health Info.
Follow-up to [48535].

Props iflairwebtechnologies, hbhalodia, mukesh27, SergeyBiryukov.
Fixes #61814.

git-svn-id: https://develop.svn.wordpress.org/trunk@58857 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-06 13:20:49 +00:00
Daniel Richards
a39a35c8e6 Theme JSON: Ensure root selector (body) is not wrapped in :root :where().
Pre-WordPress 6.6, the `body` selector was used for styles associated with the body.

In 6.6, this was mistakenly changed to `:root :where(body)`, an increase in specificity, causing some issues for themes.

This change reverts the specificity increase, styles again use the `body` selector.

Syncs PHP changes from https://github.com/WordPress/gutenberg/pull/63726.

Props talldanwp, andrewserong, aaronrobertshaw, mukesh27, hellofromtonya.
Fixes #61704.



git-svn-id: https://develop.svn.wordpress.org/trunk@58856 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-06 08:24:14 +00:00
Dennis Snell
8aca1cf6bc WP_Debug_Data: Extract wp-constants data into separate method.
This is the part two in a larger modularization of the data in `WP_Debug_Data`.
Previously this was a single massive method drawing in debug data from various
groups of related data, where the groups were independent from each other.

This patch separates the second of twelve groups, the `wp-constants` info,
into a separate method focused on that data.

This work precedes changes to make the `WP_Debug_Data` class more extensible
for better use by plugin and theme code.

Developed in https://github.com/wordpress/wordpress-develop/pull/7106
Discussed in https://core.trac.wordpress.org/ticket/61648

Props: apermo, costdev, dmsnell.
See #61648.


git-svn-id: https://develop.svn.wordpress.org/trunk@58855 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 21:37:05 +00:00
Sergey Biryukov
8e7035fd81 Menus: Check if taxonomy term exists in wp_update_nav_menu_item().
When inserting a term from a non-existing taxonomy as a nav item, the `post_title` property should be empty, and the function should not throw a fatal error for `wp_specialchars_decode()`.

Includes bringing some consistency to similar checks for post types and post type archives in the same code fragment.

Follow-up to [14283], [14450], [35382], [36095].

Props dd32, narenin, mukesh27, SergeyBiryukov.
Fixes #61799.

git-svn-id: https://develop.svn.wordpress.org/trunk@58854 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 18:58:49 +00:00
Tammie Lister
b17b5d1854 Twenty Twenty-One: Fixes float clearing elements being visible in Row and Grid blocks.
The grid layout looks different between front and back end due to the float clearing elements being visible in Row and Grid blocks. This moves the hack rather than deletes it.

Props up1512001, sabernhardt, poena.
Fixes #61611.


git-svn-id: https://develop.svn.wordpress.org/trunk@58853 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 10:07:32 +00:00
Tammie Lister
ddd53c27ad Twenty Sixteen: Fixes Code block not showing same line-height and padding on front and in editor.
The Code block had a difference in line-height and padding in the editor and front end. This does not fix font-family which has another ticket.

Props viralsampat, sabernhardt.
Fixes #61700.


git-svn-id: https://develop.svn.wordpress.org/trunk@58852 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 09:49:14 +00:00
Tammie Lister
8b2ff8636f Twenty Nineteen: Fixes Button block not changing appearance settings.
The Button block isn't reflecting appearance settings. This fix keeps the default as font-weight bold but also adds support for other weights.

Props pranitdugad, pitamdey, sabernhardt.
Fixes #61437.


git-svn-id: https://develop.svn.wordpress.org/trunk@58851 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 08:55:08 +00:00
Daniel Richards
d842ee4598 Block Styles: Fix ordering of stylesheets when a style variation is applied.
Adjusts the dependency order to ensure stylesheets are output in the correct order.

Syncs the PHP changes from https://github.com/WordPress/gutenberg/pull/63918.

Props talldanwp, aaronrobertshaw, andrewserong, aristath, mukesh27, ramonopoly, ytfeldrawkcab.
Fixes #61748.



git-svn-id: https://develop.svn.wordpress.org/trunk@58850 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 06:39:21 +00:00
Robert Anderson
471a6195d0 Media: Automatically convert HEIC images to JPEG
Automatically create a JPEG version of uploaded HEIC images if the server has
a version of Imagick that supports HEIC. Conversion is done silently through
the existing `WP_Image_Editor` infrastructure that creates multiple sizes of
uploaded images.

This allows users to view HEIC images in WP Admin and use them in their posts
and pages regardless of whether their browser supports HEIC. Browser support
for HEIC is relatively low (only Safari) while the occurrence of HEIC images is
relatively common. The original HEIC image can be downloaded via a link on
the attachment page.

Props adamsilverstein, noisysocks, swissspidy, spacedmonkey, peterwilsoncc.
Fixes #53645.


git-svn-id: https://develop.svn.wordpress.org/trunk@58849 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-05 04:11:40 +00:00
Peter Wilson
0a12ad2890 General: Removing static from wp_get_wp_version().
Removes the static storing the version number in `wp_get_wp_version()` to ensure the version number is reported correctly after a WordPress upgrade is completed.

Reverts [58827].

Props costdev, SergeyBiryukov, Cybr.
See #61782.


git-svn-id: https://develop.svn.wordpress.org/trunk@58848 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-04 22:07:06 +00:00
Sergey Biryukov
54e2272b95 Site Health: Display raw value for max_file_uploads on Site Health Info screen.
This resolves a fatal error if `strict_types` PHP setting is enabled:
{{{
Argument #1 ($num) must be of type float, string given
}}}

Since the goal of the Site Health Info screen is to display raw values where possible, the `number_format()` call here does not seem to provide any benefit.

Props krishneup, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #60364.

git-svn-id: https://develop.svn.wordpress.org/trunk@58847 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-04 22:01:28 +00:00
Sergey Biryukov
e4b3f44306 Docs: Correct documentation for the_password_form hook.
This replaces an outdated note about the 20 characters limit on the password field in the WordPress database schema.

The `post_password` column was increased to 255 characters in WordPress 4.7.

Follow-up to [27676], [38590].

Props debarghyabanerjee, peterwilsoncc, dd32, mukesh27.
Fixes #61703.

git-svn-id: https://develop.svn.wordpress.org/trunk@58846 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-03 18:30:51 +00:00
Dennis Snell
bdef9de86c HTML API: Fix an infinite loop in certain unclosed SCRIPT tags.
When the Tag Processor (or HTML Processor) attempts to parse certain
incomplete script tags, the parser enters an infinite loop and will
hang indefinitely. The conditions to reach this situation are:

- Input HTML ends with an open script tag.
- The final character of input is `-` or `<`.

The infinite loop was caused by the parser-advancing increment not being
called when two `||` OR conditions short-circuited. If the first
condition was true, the `$at++` code was never reached.

This path resolves the issue.

Developed in https://github.com/wordpress/wordpress-develop/pull/7128
Discussed in https://core.trac.wordpress.org/ticket/61810

Follow-up to [55203].

Props: dmsnell, jonsurrell.
Fixes #61810.


git-svn-id: https://develop.svn.wordpress.org/trunk@58845 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-02 23:46:45 +00:00
Dennis Snell
0c46e2a0b4 HTML API: Indicate when WordPress rejects attribute updates.
When setting an an attribute value in the HTML API, WordPress may reject
an update based on rules in `kses`. In these cases, the return value from
an escaping function will be an empty string, and the HTML API should
reject the update. Unfortunately, it currently reports that it updates the
attribute but sets an empty string value, which is misleading.

In this patch, the HTML API will refuse the attribute update and return
false to indicate as much when WordPress rejects the updates.

Developed in https://github.com/wordpress/wordpress-develop/pull/7114
Discussed in https://core.trac.wordpress.org/ticket/61719

Follow-up to [58472].

Props: amitraj2203, dmsnell, mukesh27.
Fixes #61719.


git-svn-id: https://develop.svn.wordpress.org/trunk@58844 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-02 22:57:46 +00:00
Peter Wilson
0e06e2b522 General: Use clean WordPress version in is_wp_version_compatible().
Update `is_wp_version_compatible()` to use `wp_get_wp_version()` introduced in [58813] to ensure the value of `$wp_version` has not been modified by a theme or plugin.

Props costdev, mukesh27, Cybr, sergeybiryukov.
Fixes #61781.



git-svn-id: https://develop.svn.wordpress.org/trunk@58843 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-02 22:36:27 +00:00
Sergey Biryukov
da0f44fdff Docs: Improve the wording for cron_reschedule_event_error action description.
Follow-up to [54258].

Props NekoJonez, audrasjb.
See #61608.

git-svn-id: https://develop.svn.wordpress.org/trunk@58842 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-02 19:38:44 +00:00
Dennis Snell
a799101e46 HTML API: Add support for IN SELECT IN TABLE parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN SELECT IN TABLE insertion mode. This small section of the
spec handles rules for the `<select>` element and its children when found
inside of a `<table>`.

Developed in https://github.com/wordpress/wordpress-develop/pull/7044
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58841 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-01 22:51:11 +00:00
Dennis Snell
6afe6bc178 HTML API: Add support for IN CAPTION parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN CAPTION insertion mode. This small section of the
spec handles rules for the `<caption>` element.

Developed in https://github.com/wordpress/wordpress-develop/pull/7041
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58840 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-01 22:34:29 +00:00
Dennis Snell
5b8e0ec00b HTML API: Add support for IN COLUMN GROUP parsing.
As part of work to add more spec support to the HTML API, this patch adds
support for the IN COLUMN GROUP insertion mode. This small section of the
spec handles rules for the `<colgroup>` element.

Developed in https://github.com/wordpress/wordpress-develop/pull/7042
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58839 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-01 22:04:44 +00:00
Sergey Biryukov
d0566719b3 Docs: Correct some typos in a comment in wp_salt().
Follow-up to [58837].

Props kebbet.
Fixes #59871.

git-svn-id: https://develop.svn.wordpress.org/trunk@58838 602fd350-edb4-49c9-b593-d223f7449a82
2024-08-01 20:30:48 +00:00
Peter Wilson
74e03e3cbe Options, Meta APIs: Prime salts when stored in database.
For salts generated and stored in the database, use `wp_prime_site_option_caches()` within `wp_salt()` to prime the options in a single database query, down from up to nine database queries.

The options are primed when the corresponding constant is either undefined or uses the default string `put your unique phrase here`.

Props joemcgill, spacedmonkey, peterwilsoncc.
Fixes #59871.



git-svn-id: https://develop.svn.wordpress.org/trunk@58837 602fd350-edb4-49c9-b593-d223f7449a82
2024-07-31 22:56:32 +00:00
Dennis Snell
883146e8a5 HTML API: Introduce full parsing mode in HTML Processor.
The HTML Processor has only supported a specific kind of parsing mode
called _the fragment parsing mode_, where it behaves in the same way
that `node.innerHTML = html` does in the DOM. This mode assumes a
context node and doesn't support parsing an entire document.

As part of work to add more spec support to the HTML API, this patch
introduces a full parsing mode, which can parse a full HTML document
from start to end, including the doctype declaration and head tags.

Developed in https://github.com/wordpress/wordpress-develop/pull/6977
Discussed in https://core.trac.wordpress.org/ticket/61576

Props: dmsnell, jonsurrell.
See #61576.


git-svn-id: https://develop.svn.wordpress.org/trunk@58836 602fd350-edb4-49c9-b593-d223f7449a82
2024-07-31 16:54:23 +00:00