aboutsummaryrefslogtreecommitdiff
path: root/mod/search/start.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-02-25 12:58:21 -0800
committerBrett Profitt <brett.profitt@gmail.com>2012-02-25 12:58:21 -0800
commit6c94d823bbea21a5ab5672a3d7780ad598e1c665 (patch)
tree52759cb28c782fab41dec73f806091dd350693ce /mod/search/start.php
parent6c7ff96f073dc35a9e43e80e80121f2b0463b06d (diff)
downloadelgg-6c94d823bbea21a5ab5672a3d7780ad598e1c665.tar.gz
elgg-6c94d823bbea21a5ab5672a3d7780ad598e1c665.tar.bz2
Fixes #3550. Merged slightly modified pull request 166 from sembrestels.
Diffstat (limited to 'mod/search/start.php')
-rw-r--r--mod/search/start.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/mod/search/start.php b/mod/search/start.php
index bb8531e9c..d2d7ed3c2 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -83,15 +83,18 @@ function search_page_handler($page) {
* @param string $query
* @param int $min_match_context = 30
* @param int $max_length = 300
+ * @param bool $tag_match Search is for tags. Don't ignore words.
* @return string
*/
-function search_get_highlighted_relevant_substrings($haystack, $query, $min_match_context = 30, $max_length = 300) {
+function search_get_highlighted_relevant_substrings($haystack, $query, $min_match_context = 30, $max_length = 300, $tag_match = false) {
$haystack = strip_tags($haystack);
$haystack_length = elgg_strlen($haystack);
$haystack_lc = elgg_strtolower($haystack);
- $words = search_remove_ignored_words($query, 'array');
+ if (!$tag_match) {
+ $words = search_remove_ignored_words($query, 'array');
+ }
// if haystack < $max_length return the entire haystack w/formatting immediately
if ($haystack_length <= $max_length) {