Skip to content

Commit a7480fa

Browse files
committed
fix: improve regex handling
1 parent 797650b commit a7480fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/admin/feedzy-rss-feeds-actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ private function search_replace() {
401401
$search = $this->current_job->data->search;
402402
$replace = $this->current_job->data->searchWith;
403403

404-
if ( preg_match( '/^\/.*\/[imsxuADU]*$/', $search ) ) {
405-
return preg_replace( $search, $replace, $content );
404+
if ( ! preg_match( '/^\/.*\/[imsxuADU]*$/', $search ) ) {
405+
$search = '/' . $search . '/i';
406406
}
407407

408-
return str_replace( $search, $replace, $content );
408+
return preg_replace( $search, $replace, $content );
409409
}
410410

411411
/**

0 commit comments

Comments
 (0)