aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-10 03:55:45 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-10 03:55:45 +0000
commit7fe92777c2e55a3536d4b6b18603d6e067918a7c (patch)
tree650dd9dc73338844fdafabf85abc735b1992e653
parent12779ad9e454aa4872bf564849f94db0081a7cd9 (diff)
downloadelgg-7fe92777c2e55a3536d4b6b18603d6e067918a7c.tar.gz
elgg-7fe92777c2e55a3536d4b6b18603d6e067918a7c.tar.bz2
Adjusted default context length to 500.
Added url decoding to needle string. git-svn-id: http://code.elgg.org/elgg/trunk@3653 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/search/start.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/mod/search/start.php b/mod/search/start.php
index a53cebbb6..895e806b2 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -86,9 +86,9 @@ function search_page_handler($page) {
* @param unknown_type $max_length
* @return unknown_type
*/
-function search_get_highlighted_relevant_substrings($haystack, $needle, $min_match_context = 15, $max_length = 250) {
+function search_get_highlighted_relevant_substrings($haystack, $needle, $min_match_context = 15, $max_length = 500) {
global $CONFIG;
- $haystack = strip_tags($haystack);
+ $haystack = url_decode(strip_tags($haystack));
$haystack_lc = strtolower($haystack);
//
// $haystack = "Like merge sort, quicksort can also be easily parallelized due to its "
@@ -100,6 +100,7 @@ function search_get_highlighted_relevant_substrings($haystack, $needle, $min_mat
// for now don't worry about "s or boolean operators
$needle = str_replace(array('"', '-', '+', '~'), '', stripslashes(strip_tags($needle)));
+ $needle = url_decode($needle);
$words = explode(' ', $needle);
$min_chars = $CONFIG->search_info['min_chars'];