aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-02-25 22:09:53 +0000
committerNils Adermann <naderman@naderman.de>2007-02-25 22:09:53 +0000
commitb66e0fcd34d3209ca86059d1737125699a726a7d (patch)
tree96f2a08d958122e7f0c4780c718694646ac4e846 /phpBB/search.php
parent424a520d0e3d8f668b70c632a8d787f004d8098b (diff)
downloadforums-b66e0fcd34d3209ca86059d1737125699a726a7d.tar
forums-b66e0fcd34d3209ca86059d1737125699a726a7d.tar.gz
forums-b66e0fcd34d3209ca86059d1737125699a726a7d.tar.bz2
forums-b66e0fcd34d3209ca86059d1737125699a726a7d.tar.xz
forums-b66e0fcd34d3209ca86059d1737125699a726a7d.zip
- fix htmlspecialchars handling in search (search backends get specialchared input, and should return specialchared output), current backends strip entities anyway [includes Bug #8156]
- allow cancelling search index creation/removal - custom CSS class name input too short [Bug #8328] - give an error message if a password wasn't convertable (special characters in non-standard encoding) - moved still_on_time to functions.php, used by acp_search and converter, might be useful for MODs (or complex cron scripts) - do not allow empty passwords on login - add sids to local URLs in posts (this was a really terrible bug to fix ;-)) [Bug #7892] - ignore invalid HTTP_X_FORWARDED_FOR headers (just use REMOTE_ADDR if invalid) [Bug #8314] - changed forum listing code on search page and acp_attachments [Bug #6658] - search indexing uses still_on_time(), smaller batch size (1000) and meta_refresh() instead of redirect(), this should solve a few problems [Bugs #8034, #8270] - made password requirement language strings clearer - ALPHA is not meant to be alphanumric [Bug #7764] - display bug in firefox on linux making the pagination wrap on search results page (caused by &nbsp;) git-svn-id: file:///svn/phpbb/trunk@7076 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 3e4159025a..191238c8b0 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -234,7 +234,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$correct_query = $search->split_keywords($keywords, $search_terms);
if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
{
- $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], htmlspecialchars(implode(' ', $search->common_words), ENT_COMPAT, 'UTF-8')) . '<br />' : '';
+ $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
}
}
@@ -453,8 +453,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// define some vars for urls
- $hilit = htmlspecialchars(implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')'), ' ', $keywords)))));
- $u_hilit = urlencode($keywords);
+ $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')'), ' ', $keywords))));
+ $u_hilit = urlencode(htmlspecialchars_decode($keywords));
$u_show_results = ($show_results != 'posts') ? '&amp;sr=' . $show_results : '';
$u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
@@ -472,8 +472,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$template->assign_vars(array(
'SEARCH_TITLE' => $l_search_title,
'SEARCH_MATCHES' => $l_search_matches,
- 'SEARCH_WORDS' => preg_replace('#&amp;(\#[0-9]+;)#', '&$1', htmlspecialchars($search->search_query)),
- 'IGNORED_WORDS' => (sizeof($search->common_words)) ? htmlspecialchars(implode(' ', $search->common_words)) : '',
+ 'SEARCH_WORDS' => $search->search_query,
+ 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
'TOTAL_MATCHES' => $total_match_count,
@@ -960,6 +960,8 @@ while ($row = $db->sql_fetchrow($result))
if ($row['left_id'] > $cat_right)
{
+ // make sure we don't forget anything
+ $s_forums .= $holding;
$holding = '';
}
@@ -1040,7 +1042,7 @@ $result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
- $keywords = htmlspecialchars($row['search_keywords'], ENT_COMPAT, 'UTF-8');
+ $keywords = $row['search_keywords'];
$template->assign_block_vars('recentsearch', array(
'KEYWORDS' => $keywords,