diff options
author | Nils Adermann <naderman@naderman.de> | 2006-08-29 20:25:28 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2006-08-29 20:25:28 +0000 |
commit | 457078f2cfcd114e84b33c123e83eab79e350d0c (patch) | |
tree | 3baa57df6f6ad8e10cd8672f39b615b0e0eb75f0 /phpBB/search.php | |
parent | 1564013fdd427691df22fcba7b372c5e1f8922e4 (diff) | |
download | forums-457078f2cfcd114e84b33c123e83eab79e350d0c.tar forums-457078f2cfcd114e84b33c123e83eab79e350d0c.tar.gz forums-457078f2cfcd114e84b33c123e83eab79e350d0c.tar.bz2 forums-457078f2cfcd114e84b33c123e83eab79e350d0c.tar.xz forums-457078f2cfcd114e84b33c123e83eab79e350d0c.zip |
- only highlight when there is anything to highlight
git-svn-id: file:///svn/phpbb/trunk@6330 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r-- | phpBB/search.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index ae3d9b73a3..a2feeab37c 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -808,8 +808,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) $message = smiley_text($message); } - // post highlighting - $message = preg_replace('#(?!(?:<(?:s(?:cript|tyle))?)[^<]*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $message); + if ($hilit) + { + // post highlighting + $message = preg_replace('#(?!(?:<(?:s(?:cript|tyle))?)[^<]*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $message); + } $tpl_ary = array( 'POSTER_NAME' => ($row['poster_id'] == ANONYMOUS) ? ((!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], |