55 array_walk($aTermsToMark,
58 $v = preg_quote($v,
'~');
61 $search_string = implode(
"|", $aTermsToMark);
62 $string = $search_string;
71 $matches = preg_split(
"~(\[\[.*\]\]|<style.*</style>|<script.*</script>|<pre.*</pre>|<code.*</code>|<!--.*-->|<(?:[^<]|<.*>)*>|\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,8}\b)~iUs",$sContent,-1,(PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY));
72 if (is_array($matches) && $matches != array())
75 foreach ($matches as $match)
77 if ($match[0] !=
"<" && !preg_match(
'/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,8}$/i', $match) && !preg_match(
'~\[\[.*\]\]~', $match))
80 array(
'<',
'>',
'&',
'"',
''',
' '),
81 array(
'<',
'>',
'&',
'"',
'\'',
"\xC2\xA0"),
85 $match = preg_replace(
87 '_span class=_highlight__$1_/span_',
92 array(
'&',
'<',
'>',
'"',
'\'',
"\xC2\xA0"),
93 array(
'&',
'<',
'>',
'"',
''',
' '),
98 array(
'_span class=_highlight__',
'_/span_'),
99 array(
'<span class="highlight">',
'</span>'),