summaryrefslogtreecommitdiff
path: root/modules/search/search.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/search/search.module')
-rw-r--r--modules/search/search.module7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/search/search.module b/modules/search/search.module
index 915c96fb2..910cb6520 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -68,7 +68,7 @@ function search_help($path, $arg) {
case 'admin/help#search':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Search module provides the ability to index and search for content by exact keywords, and for users by username or e-mail. For more information, see the online handbook entry for <a href="@search-module">Search module</a>.', array('@search-module' => 'http://drupal.org/handbook/modules/search/', '@search' => url('search'))) . '</p>';
+ $output .= '<p>' . t('The Search module provides the ability to index and search for content by exact keywords, and for users by username or e-mail. For more information, see the online handbook entry for <a href="@search-module">Search module</a>.', array('@search-module' => 'http://drupal.org/documentation/modules/search/', '@search' => url('search'))) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Searching content and users') . '</dt>';
@@ -1293,6 +1293,11 @@ function search_simplify_excerpt_match($key, $text, $offset, $boundary) {
$simplified_key = search_simplify($key);
$simplified_text = search_simplify($text);
+ // Return immediately if simplified key or text are empty.
+ if (!$simplified_key || !$simplified_text) {
+ return FALSE;
+ }
+
// Check if we have a match after simplification in the text.
if (!preg_match('/' . $boundary . $simplified_key . $boundary . '/iu', $simplified_text, $match, PREG_OFFSET_CAPTURE, $offset)) {
return FALSE;