aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-04-16 11:08:31 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-04-16 11:08:31 +0200
commit01030bb3a9dbc158f39a190d2ff187de52e606f4 (patch)
treed1052bf785dbb70af81b50fce964ce253f1a8096 /phpBB/viewtopic.php
parent61f4802b5a40c0d30de8398a058a24baf2cab182 (diff)
parentb305364b278cb224346a4a98cfdace24b2f3b845 (diff)
downloadforums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar
forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.gz
forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.bz2
forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.tar.xz
forums-01030bb3a9dbc158f39a190d2ff187de52e606f4.zip
Merge branch 'develop-ascraeus' of https://github.com/phpbb/phpbb into ticket/12407
Conflicts: phpBB/posting.php
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 1a74ad3e38..ad7e8c29bc 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -422,17 +422,11 @@ else
$highlight_match = $highlight = '';
if ($hilit_words)
{
- foreach (explode(' ', trim($hilit_words)) as $word)
- {
- if (trim($word))
- {
- $word = str_replace('\*', '\w+?', preg_quote($word, '#'));
- $word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word);
- $highlight_match .= (($highlight_match != '') ? '|' : '') . $word;
- }
- }
-
- $highlight = urlencode($hilit_words);
+ $highlight_match = phpbb_clean_search_string($hilit_words);
+ $highlight = urlencode($highlight_match);
+ $highlight_match = str_replace('\*', '\w+?', preg_quote($highlight_match, '#'));
+ $highlight_match = preg_replace('#(?<=^|\s)\\\\w\*\?(?=\s|$)#', '\w+?', $highlight_match);
+ $highlight_match = str_replace(' ', '|', $highlight_match);
}
// Make sure $start is set to the last page if it exceeds the amount
@@ -1674,15 +1668,18 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @var int start Start item of this page
* @var int current_row_number Number of the post on this page
* @var int end Number of posts on this page
+ * @var int total_posts Total posts count
* @var array row Array with original post and user data
* @var array cp_row Custom profile field data of the poster
* @var array attachments List of attachments
* @var array user_poster_data Poster's data from user cache
* @var array post_row Template block array of the post
+ * @var array topic_data Array with topic data
* @since 3.1-A1
* @change 3.1.0-a3 Added vars start, current_row_number, end, attachments
+ * @change 3.1.0-b3 Added topic_data array, total_posts
*/
- $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row', 'topic_data');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars)));
$i = $current_row_number;