Skip to content

Commit 55d2dcd

Browse files
committed
Respect text capitalization in previews when doing a non-regex search
1 parent 4024ee6 commit 55d2dcd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/php/includes/class-string-locator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ function scan_file( $filename, $string, $location, $type, $slug, $regex = false
13631363
if ( $regex ) {
13641364
$string_preview = preg_replace( preg_replace( '/\/(.+)\//', '/($1)/', $string ), '<strong>$1</strong>', esc_html( $string_preview ) );
13651365
} else {
1366-
$string_preview = str_ireplace( $string, '<strong>' . $string . '</strong>', esc_html( $string_preview ) );
1366+
$string_preview = preg_replace( '/(' . $string . ')/i', '<strong>$1</strong>', esc_html( $string_preview ) );
13671367
}
13681368
if ( $string_preview_is_cut ) {
13691369
$string_preview = sprintf(

0 commit comments

Comments
 (0)