From 0db2ed146f2da68ffba1a64b891988a5fb126ee1 Mon Sep 17 00:00:00 2001 From: Mike Gozdiskowski Date: Fri, 1 May 2026 15:47:31 -0400 Subject: [PATCH 1/2] Fix: Add word boundary to prevent improper empty string replacement --- .../wpcomsh/footer-credit/footer-credit-optimizations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/plugins/wpcomsh/footer-credit/footer-credit-optimizations.php b/projects/plugins/wpcomsh/footer-credit/footer-credit-optimizations.php index 2d4eec64fc22..801bc25d6052 100644 --- a/projects/plugins/wpcomsh/footer-credit/footer-credit-optimizations.php +++ b/projects/plugins/wpcomsh/footer-credit/footer-credit-optimizations.php @@ -126,7 +126,7 @@ function wpcom_better_footer_links( $footer ) { $theme_regex = array( '(?:\s*\|\s*)?', // Optional pipe with spaces (non-capturing) '(?:]+>)?', // Optional opening span tag (non-capturing) - '(Theme|%s)', // $1: "Theme" or the localized equivalent + '(\bTheme\b|%s)', // $1: "Theme" or the localized equivalent (word boundaries prevent partial match) '\s*(?: )?:?\s*', // Zero or more whitespace characters, an optional colon, zero or more whitespace characters '(%s|]+>%s)', // $2: The theme name, or link '\.?', // Optional period From 1e2773e4a9be068cd47d210df35c037cad7b2b83 Mon Sep 17 00:00:00 2001 From: Mike Gozdiskowski Date: Fri, 1 May 2026 15:55:12 -0400 Subject: [PATCH 2/2] Add changelog --- projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit diff --git a/projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit b/projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit new file mode 100644 index 000000000000..fbd84fadfc65 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Added word boundary to prevent replacing first instance of the word theme with an empty string when a theme doesn't have a valid style.css