aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-05-13 16:15:20 +0000
committerNils Adermann <naderman@naderman.de>2007-05-13 16:15:20 +0000
commit4b876ffee5b714bcd7fbf8eb2df022f32251a9ff (patch)
tree77a8557507f9fd919486683e2566db34a64fc2f2 /phpBB/search.php
parentb8daa787095eece45eeb3e1b6351efbed292bbd1 (diff)
downloadforums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.gz
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.bz2
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.tar.xz
forums-4b876ffee5b714bcd7fbf8eb2df022f32251a9ff.zip
- correctly transfer the search query across search result pages
- changed highlighting so foo* will match foo again [Bug #10031] - restructured magic urls (functionality still mostly the same), added a check for entities in urls and punctuation at the end of magic urls [Bugs #10639, #10293] - undid the workaround for urls in quotes, as it's fixed by the new magic url handling - allow magic urls enclosed in BBCode [Bug #10319] - added handling for IPv6 addresses to the IP checking without adding extra options [Bug #9538] - correctly handle search in search results of search queries with brackets [Bug #10581] - added information about requirements for auth_apache [Bug #10107] git-svn-id: file:///svn/phpbb/trunk@7559 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 214ceeefa6..ed1b43fd9e 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -135,7 +135,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// Which forums should not be searched? Author searches are also carried out in unindexed forums
- if (empty($search->search_query) && sizeof($author_id_ary))
+ if (empty($keywords) && sizeof($author_id_ary))
{
$ex_fid_ary = array_keys($auth->acl_getf('!f_read', true));
}
@@ -460,7 +460,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
$u_search .= ($search_id) ? '&amp;search_id=' . $search_id : '';
- $u_search .= ($u_hilit) ? '&amp;keywords=' . $u_hilit : '';
+ $u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
$u_search .= ($topic_id) ? '&amp;t=' . $topic_id : '';
$u_search .= ($author) ? '&amp;author=' . urlencode(htmlspecialchars_decode($author)) : '';
$u_search .= ($author_id) ? '&amp;author_id=' . $author_id : '';
@@ -711,7 +711,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit_array = array_filter(explode('|', $hilit), 'strlen');
foreach ($hilit_array as $key => $value)
{
- $hilit_array[$key] = str_replace('\*', '\w+?', preg_quote($value, '#'));
+ $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($value, '#'));
+ $hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]);
}
$hilit = implode('|', $hilit_array);
}
@@ -812,7 +813,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$template->assign_block_vars('searchresults', array(
'S_IGNORE_POST' => true,
- 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['username'], "<a href=\"$u_search&amp;p=" . $row['post_id'] . '&amp;view=show#p' . $row['post_id'] . '">', '</a>'))
+ 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['username'], "<a href=\"$u_search&amp;start=$start&amp;p=" . $row['post_id'] . '&amp;view=show#p' . $row['post_id'] . '">', '</a>'))
);
continue;