Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/plugins/wpcomsh/changelog/DOTTHEM-343-footer-credit
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function wpcom_better_footer_links( $footer ) {
$theme_regex = array(
'(?:\s*\|\s*)?', // Optional pipe with spaces (non-capturing)
'(?:<span\s[^>]+>)?', // 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*(?:&nbsp;)?:?\s*', // Zero or more whitespace characters, an optional colon, zero or more whitespace characters
'(%s|<a[^>]+>%s</a>)', // $2: The theme name, or link
'\.?', // Optional period
Expand Down