Repository navigation
Conversation
… output. Upgrader debug messages logged to the browser console were passed through `wp.sanitize.stripTagsAndEncodeText()`, which returns HTML-escaped text. As the console displays plain text, messages such as "Unpacking the package&WordPress#8230;" were shown with the raw character reference. This strips tags and decodes character references using `DOMParser` before logging, and skips non-string messages. Includes QUnit tests for `wp.updates.ajaxAlways()`, and fixes the `_wpUpdatesItemCounts` test fixture so that `updates.js` can be loaded in the QUnit suite. Fixes #59890. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014nJenDidRzoohF8JCEKbZ9
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @ashish.anant@a8c.com. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Upgrader debug messages from Shiny Updates are logged to the browser console via
wp.sanitize.stripTagsAndEncodeText(), which intentionally returns HTML-escaped text. Because the console shows plain text, messages appear with raw character references, e.g.Unpacking the package….This PR strips tags and decodes character references with
DOMParser(body.textContent) before logging, and skips non-string messages.stripTagsAndEncodeText()itself is unchanged, as other callers rely on its escaped output. Decoding happens client-side only because the same messages are also used in emails/logs server-side.Tests
wp.updates.ajaxAlways()(tests/qunit/wp-admin/js/updates-ajax-always.js): decoding, tag stripping, no markup execution, non-string skipping. They fail without the fix.updates.jsin the QUnit suite and fixes the_wpUpdatesItemCountsfixture (totalslackedcounts, which maderefreshCount()throw on load).Testing instructions
Downloading installation package from …zip…. After:Downloading installation package from …zip….Trac ticket: https://core.trac.wordpress.org/ticket/59890
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Investigation, implementation, tests and local verification, under my direction.
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.
🤖 Generated with Claude Code
https://claude.ai/code/session_014nJenDidRzoohF8JCEKbZ9