diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-24 00:36:00 -0600 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-24 00:36:00 -0600 |
commit | a6e6b2e96b3bb174a656b71149808add7d488b39 (patch) | |
tree | b9843314c44ee69aeaa11d9b45fb7db173085d5c /modules/search/search.module | |
parent | 19784139297a565c45ca1d3e59e8429c502d7c23 (diff) | |
download | brdo-a6e6b2e96b3bb174a656b71149808add7d488b39.tar.gz brdo-a6e6b2e96b3bb174a656b71149808add7d488b39.tar.bz2 |
Issue #1335388 by wojtha: Fixed Warning: strpos(): Empty delimiter in search_simplify_excerpt_match().
Diffstat (limited to 'modules/search/search.module')
-rw-r--r-- | modules/search/search.module | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/search/search.module b/modules/search/search.module index 915c96fb2..33cd77eae 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -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; |