From 581add097a3d848094c0340fcaaa4b5c9e5ef111 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 23 Nov 2015 16:03:03 -0500 Subject: [PATCH] added regex --- search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.php b/search.php index 8aac996..f334542 100644 --- a/search.php +++ b/search.php @@ -38,7 +38,7 @@ // Load content as plain text global $wp_query, $post; $content = (!post_password_required($post) ? strip_tags(preg_replace(array("/\r?\n/", '@<\s*(p|br\s*/?)\s*>@'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); - + $content = preg_replace('!\s+!', ' ', $content); // Search content for terms $terms = $wp_query->query_vars['search_terms']; if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) { -- 2.17.1