Repository navigation
Escape the short post date format instead of ignoring PHPCS - #245
Merged
Merged
Conversation
The Archive Minimal, Archive Simple and All Archives Sidebar patterns echoed serialize_block_attributes() behind a phpcs:ignore for WordPress.Security.EscapeOutput.OutputNotEscaped. Wrap it in wp_kses( …, array() ) instead. serialize_block_attributes() already writes <, >, &, quotes and backslashes as \u00XX escapes, so kses leaves the attributes unchanged and the block comment stays valid JSON for any translation of the format. Follow-up to #224, see #217. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
juanfra
reviewed
Nov 16, 2026
| <div class="wp-block-group" style="border-bottom-style:dotted;border-bottom-width:1px;padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)"><!-- wp:post-title {"isLink":true,"className":"is-style-text-display","style":{"typography":{"fontStyle":"normal","fontWeight":"600","letterSpacing":"-0.04rem"}}} /--> | ||
|
|
||
| <!-- wp:post-date <?php echo serialize_block_attributes( array( 'format' => /* translators: Short date format without the year, see https://www.php.net/manual/datetime.format.php */ _x( 'M j', 'short date format without the year', 'ipsum' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- serialize_block_attributes() escapes for HTML comments. ?> /--></div> | ||
| <!-- wp:post-date <?php echo wp_kses( serialize_block_attributes( array( 'format' => /* translators: Short date format without the year, see https://www.php.net/manual/datetime.format.php */ _x( 'M j', 'short date format without the year', 'ipsum' ) ) ), array() ); ?> /--></div> |
Member
There was a problem hiding this comment.
Not a blocker, but given that wp_kses() only satisfies the escaping sniff and doesn’t change the output, we could have a comment so that it's not removed by accident.
MaggieCabrera
added a commit
to MaggieCabrera/wordpress-develop
that referenced
this pull request
Nov 16, 2026
The Archive Minimal, Archive Simple and All Archives Sidebar patterns now escape the translatable short date format instead of skipping the escaping check with `phpcs:ignore`. The block's JSON stays valid for any translation, and the string is unchanged ahead of the RC 1 string freeze. Synced from WordPress/ipsum#245. See #66678. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wporg-sync
pushed a commit
to WordPress/wordpress-develop
that referenced
this pull request
Nov 17, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch. A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e - Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216) - Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203) - Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200) - Improve design guide defaults and schema descriptions (WordPress/ipsum#193) - Make the short post date format translatable (WordPress/ipsum#224) - Fix Details block markers being announced by screen readers (WordPress/ipsum#230) - Remove the physical left alignment from the page patterns (WordPress/ipsum#226) - Indent the navigation submenus on the inline start (WordPress/ipsum#225) - Fix accessible names for overlay navigation (WordPress/ipsum#228) - Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214) - Use a logical margin for the comment form checkbox (WordPress/ipsum#231) - Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145) - Fix accessible name of overlay search form (WordPress/ipsum#239) - Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238) - Keep the post date on one line when categories wrap (WordPress/ipsum#205) - Remove repeated button styles from theme.json (WordPress/ipsum#235) - Remove unused values from theme.json (WordPress/ipsum#237) - Make the credit line URL translatable (WordPress/ipsum#240) - Use single border radius values in theme.json (WordPress/ipsum#236) - Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245) - Use the Site Title in Footer Centered (WordPress/ipsum#244) - Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247) - Treat "Written by" as a label before the author name (WordPress/ipsum#246) - Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232) This commit also includes changes that only exist in core: - Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles. - `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`. - A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match". Developed in: #15948 Follow-up to r65366. Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi. Fixes #66678. See #66352. git-svn-id: https://develop.svn.wordpress.org/trunk@65549 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync
pushed a commit
to WordPress/WordPress
that referenced
this pull request
Nov 17, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch. A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e - Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216) - Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203) - Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200) - Improve design guide defaults and schema descriptions (WordPress/ipsum#193) - Make the short post date format translatable (WordPress/ipsum#224) - Fix Details block markers being announced by screen readers (WordPress/ipsum#230) - Remove the physical left alignment from the page patterns (WordPress/ipsum#226) - Indent the navigation submenus on the inline start (WordPress/ipsum#225) - Fix accessible names for overlay navigation (WordPress/ipsum#228) - Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214) - Use a logical margin for the comment form checkbox (WordPress/ipsum#231) - Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145) - Fix accessible name of overlay search form (WordPress/ipsum#239) - Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238) - Keep the post date on one line when categories wrap (WordPress/ipsum#205) - Remove repeated button styles from theme.json (WordPress/ipsum#235) - Remove unused values from theme.json (WordPress/ipsum#237) - Make the credit line URL translatable (WordPress/ipsum#240) - Use single border radius values in theme.json (WordPress/ipsum#236) - Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245) - Use the Site Title in Footer Centered (WordPress/ipsum#244) - Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247) - Treat "Written by" as a label before the author name (WordPress/ipsum#246) - Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232) This commit also includes changes that only exist in core: - Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles. - `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`. - A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match". Developed in: WordPress/wordpress-develop#15948 Follow-up to r65366. Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi. Fixes #66678. See #66352. Built from https://develop.svn.wordpress.org/trunk@65549 git-svn-id: http://core.svn.wordpress.org/trunk@64622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12
pushed a commit
to arshidkv12/wordpress-develop
that referenced
this pull request
Nov 21, 2026
This updates Ipsum from `bc2e5af700e28980f251d97f58cf80c72ee50a13` to `d26734ecc1ba178d9c120178ce9d2c48825fc108` on its `trunk` branch. A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@bc2e5af...d26734e - Address the review notes from the 7.2 Beta 5 core commit (WordPress/ipsum#216) - Fix Pullquote custom line height not applying on the front end (WordPress/ipsum#203) - Fix horizontal scroll caused by long unbroken words in comments (WordPress/ipsum#200) - Improve design guide defaults and schema descriptions (WordPress/ipsum#193) - Make the short post date format translatable (WordPress/ipsum#224) - Fix Details block markers being announced by screen readers (WordPress/ipsum#230) - Remove the physical left alignment from the page patterns (WordPress/ipsum#226) - Indent the navigation submenus on the inline start (WordPress/ipsum#225) - Fix accessible names for overlay navigation (WordPress/ipsum#228) - Split AGENTS.md so it holds for any copy of the theme (WordPress/ipsum#214) - Use a logical margin for the comment form checkbox (WordPress/ipsum#231) - Keep keyboard focus visible and clear of the sticky header (WordPress/ipsum#145) - Fix accessible name of overlay search form (WordPress/ipsum#239) - Show a message when the blog and Archive Full have no posts (WordPress/ipsum#238) - Keep the post date on one line when categories wrap (WordPress/ipsum#205) - Remove repeated button styles from theme.json (WordPress/ipsum#235) - Remove unused values from theme.json (WordPress/ipsum#237) - Make the credit line URL translatable (WordPress/ipsum#240) - Use single border radius values in theme.json (WordPress/ipsum#236) - Escape the short post date format instead of ignoring PHPCS (WordPress/ipsum#245) - Use the Site Title in Footer Centered (WordPress/ipsum#244) - Keep AGENTS.md about the theme, not the GitHub repository (WordPress/ipsum#247) - Treat "Written by" as a label before the author name (WordPress/ipsum#246) - Use Quote blocks for statement patterns and remove text quote mark styles (WordPress/ipsum#232) This commit also includes changes that only exist in core: - Tests for the `ipsum/get-design-guide` ability are added in `tests/phpunit/tests/theme/ipsumGetDesignGuideAbility.php`, because Ipsum's repository has no PHPUnit setup. On multisite, the tests save global styles as a super admin, since only super admins can save unfiltered global styles. - `contributing.txt` says Ipsum is developed on GitHub until its 1.0 release, with contributions going through Trac after that. It also drops the note about `style.css` being used when it is newer than `style.min.css`. - A test message in `ipsumDesignGuide.php` says "do not match" instead of "to not match". Developed in: WordPress#15948 Follow-up to r65366. Props onemaggie, juanfra, shailu25, iamarinoh, 369work, gziolo, wildworks, suryakantupadhyay, khushalsains, ravipatel, meahadi. Fixes #66678. See #66352. git-svn-id: https://develop.svn.wordpress.org/trunk@65549 602fd350-edb4-49c9-b593-d223f7449a82
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
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.
Description
Follow-up to #224, see #217. The Archive Minimal, Archive Simple and All Archives Sidebar patterns now escape the translatable short date format instead of skipping the escaping check with
phpcs:ignore.wp_kses( serialize_block_attributes( … ), array() ).serialize_block_attributes()already writes<,>,&, quotes and backslashes as\u00XX, so kses doesn't change them, and the block's JSON stays valid for any translation.esc_attr()andesc_html()don't fit here, because they turn quotes into"and break the JSON.Testing Instructions
Nov 11.gettext_with_contextfilter that returnsj \d\e Ffor theM jstring, and insert the patterns again. The dates read like11 de November.composer run lint. It passes, andgit grep phpcs:ignorefinds nothing.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Writing the fix, testing it in a local environment, and drafting this description. I reviewed the result.
🤖 Generated with Claude Code