1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 08:17:47 +02:00

- force a default charset

- better highlight code in search


git-svn-id: file:///svn/phpbb/trunk@5972 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2006-05-27 13:25:27 +00:00
parent 6d072d8fc7
commit b51b978854
2 changed files with 71 additions and 63 deletions

View File

@@ -658,7 +658,15 @@ if ($keywords || $author || $search_id || $submit)
if ($hilit)
{
$row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . preg_quote($hilit, '#') . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">$1</span>', $row['post_text']);
// Remove bad highlights
$hilit_array = array_filter(explode('|', $hilit), 'strlen');
foreach ($hilit_array as $key => $value)
{
$hilit_array[$key] = preg_quote($value, '#');
}
$hilit = implode('|', $hilit_array);
$row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">$1</span>', $row['post_text']);
}
$row['post_text'] = smiley_text($row['post_text']);