Project

General

Profile

« Previous | Next » 

Revision 490

Added by Matthias over 17 years ago

Fixed issue with escaped single and double quotes in search result (Thanks to thorn)

View differences:

frontend.functions.php
76 76
	$string = entities_to_umlauts($search_string, 'UTF-8');
77 77
	$string = strtr($string, $string_ul_umlauts);
78 78
	// do some magic to prevent < > ... from being highlighted
79
	$foo = strtr($foo, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
80
	$string = strtr($string, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
79
	$foo = strtr($foo, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
80
	$string = strtr($string, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
81 81
	$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo);
82 82
	$pos = strpos($foo, '<');
83 83
	if ($pos === false) { // "===" means identicaly
84 84
		$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo);
85 85
	}
86
	$foo = strtr($foo, array("!,,!"=>"&lt;", "!,,,!"=>"&gt;", "!,,,,!"=>"&amp;", "!,,,,,!"=>"&quot;", "!,,,,,,!"=>"&#039;"));
86
	$foo = strtr($foo, array("!,,!"=>"&lt;", "!,,,!"=>"&gt;", "!,,,,!"=>"&amp;", "!,,,,,!"=>"&quot;", "!,,,,,,!"=>"&#39;"));
87 87
	if(DEFAULT_CHARSET != 'utf-8') {
88 88
		$foo = umlauts_to_defcharset($foo, 'UTF-8');
89 89
	}

Also available in: Unified diff