Revision 743
Added by thorn over 17 years ago
| search_modext.php | ||
|---|---|---|
| 213 | 213 |
if($mod_text == "") // nothing to do |
| 214 | 214 |
{ return false; }
|
| 215 | 215 |
if($mod_no_highlight) // no highlighting |
| 216 |
{ $mod_page_link_target = "&nohighlight".$mod_page_link_target; }
|
|
| 216 |
{ $mod_page_link_target = "&nohighlight=1".$mod_page_link_target; }
|
|
| 217 | 217 |
|
| 218 | 218 |
// prepare the text (part 1): remove lf and cr, convert \" to ", remove comments, style, scripting and unnecessary whitespace, convert to utf8 |
| 219 | 219 |
$mod_text = strtr($mod_text, array("\x0D\x0A" => ' ', "\x0D" => ' ', "\x0A" => ' ', '\"' => '"'));
|
| ... | ... | |
| 232 | 232 |
$mod_text = preg_replace('/<(br( \/)?|dt|\/dd|\/?(h[1-6]|tr|table|p|li|ul|pre|code|div|hr))[^>]*>/i', '.', $mod_text);
|
| 233 | 233 |
$mod_text = strip_tags($mod_text); |
| 234 | 234 |
|
| 235 |
// unhtmlspecialchars |
|
| 236 |
// $mod_text = strtr($mod_text, array('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"', '''=>'\'', ' '=>"\xC2\xA0"));
|
|
| 237 |
// $tmp_words = array(); |
|
| 238 |
// foreach($func_search_words as $w) {
|
|
| 239 |
// $tmp_words[] = strtr($w, array('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"', '''=>'\'', ' '=>"\xC2\xA0"));
|
|
| 240 |
// } |
|
| 241 |
// $func_search_words = $tmp_words; |
|
| 242 |
|
|
| 243 | 235 |
// Do a fast scan over $mod_text first. This will speedup things a lot. |
| 244 | 236 |
if($func_search_match == 'all') {
|
| 245 | 237 |
if(!is_all_matched($mod_text, $func_search_words)) {
|
Also available in: Unified diff
changed & to & in URL-string for nohighlight-feature and added a value