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:
@@ -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']);
|
||||
|
Reference in New Issue
Block a user