From c6cb8367263c381343e543ca644fa4f9be5c608c Mon Sep 17 00:00:00 2001 From: ArkaPrabhaChowdhury Date: Wed, 25 Nov 2026 16:21:36 +0530 Subject: [PATCH] Formatting: Match Cockney terms as whole words (trac #66776) --- src/wp-includes/formatting.php | 8 ++++-- .../phpunit/tests/formatting/wpTexturize.php | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index ad12579fdafa1..cc29bdfd0bf80 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -133,8 +133,8 @@ function wptexturize( $text, $reset = false ) { ); } - $static_characters = array_merge( array( '...', '``', '\'\'', ' (tm)' ), $cockney ); - $static_replacements = array_merge( array( '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); + $static_characters = array( '...', '``', '\'\'', ' (tm)' ); + $static_replacements = array( '…', $opening_quote, $closing_quote, ' ™' ); /* * Pattern-based replacements of characters. @@ -153,6 +153,10 @@ function wptexturize( $text, $reset = false ) { $dynamic = array(); $spaces = wp_spaces_regexp(); + foreach ( $cockney as $i => $word ) { + $dynamic[ '/(?