- correctly initialise $words in fulltext_native [Bug #347]

- display ignored words from sub-search-queries
- "Return to search page" [Bug #9591]
- spelling in coding guidelines
- htmlspecialchars forwarded_for before logging


git-svn-id: file:///svn/phpbb/trunk@7310 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2007-04-09 16:04:30 +00:00
parent 7cbf74bfca
commit 405b22f64e
5 changed files with 14 additions and 6 deletions

View file

@ -193,7 +193,7 @@ p a {
<!-- BEGIN DOCUMENT --> <!-- BEGIN DOCUMENT -->
<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible.<br />This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p> <p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow them as closely as possible.<br />This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
<h1>Coding Guidelines</h1> <h1>Coding Guidelines</h1>
@ -1550,7 +1550,7 @@ div
<h3>Reason:</h3> <h3>Reason:</h3>
<p>phpBB is one of the most translated OpenSource projects, with the current stable version being available in over 60 localisations. Whilst the ad hoc approach to the naming of language packs has worked, for phpBB3 and beyond we hope to make this process saner which will allow for better interoperation with current and future web browsers.</p> <p>phpBB is one of the most translated open-source projects, with the current stable version being available in over 60 localisations. Whilst the ad hoc approach to the naming of language packs has worked, for phpBB3 and beyond we hope to make this process saner which will allow for better interoperation with current and future web browsers.</p>
<h3>Encoding:</h3> <h3>Encoding:</h3>

View file

@ -187,7 +187,7 @@ class fulltext_native extends search_backend
preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words); preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
$exact_words = $exact_words[1]; $exact_words = $exact_words[1];
$common_ids = array(); $common_ids = $words = array();
if (sizeof($exact_words)) if (sizeof($exact_words))
{ {
@ -287,6 +287,14 @@ class fulltext_native extends search_backend
$id_words[] = $words[$word_part]; $id_words[] = $words[$word_part];
$non_common_words[] = $word_part; $non_common_words[] = $word_part;
} }
else
{
$len = utf8_strlen($word_part);
if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
{
$this->common_words[] = $word_part;
}
}
} }
if (sizeof($id_words)) if (sizeof($id_words))
{ {
@ -311,7 +319,6 @@ class fulltext_native extends search_backend
// else we only need one id // else we only need one id
else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word])) else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word]))
{ {
if ($wildcard) if ($wildcard)
{ {
$len = utf8_strlen(str_replace('*', '', $word)); $len = utf8_strlen(str_replace('*', '', $word));

View file

@ -301,7 +301,7 @@ class session
// Added logging temporarly to help debug bugs... // Added logging temporarly to help debug bugs...
if (defined('DEBUG_EXTRA')) if (defined('DEBUG_EXTRA'))
{ {
add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, $u_forwarded_for, $s_forwarded_for); add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, htmlspecialchars($u_forwarded_for), htmlspecialchars($s_forwarded_for));
} }
} }
} }

View file

@ -61,6 +61,7 @@ $lang = array_merge($lang, array(
'RESULT_DAYS' => 'Limit results to previous', 'RESULT_DAYS' => 'Limit results to previous',
'RESULT_SORT' => 'Sort results by', 'RESULT_SORT' => 'Sort results by',
'RETURN_FIRST' => 'Return first', 'RETURN_FIRST' => 'Return first',
'RETURN_TO_SEARCH_ADV' => 'Return to advanced search',
'SEARCHED_FOR' => 'Search term used', 'SEARCHED_FOR' => 'Search term used',
'SEARCHED_TOPIC' => 'Searched topic', 'SEARCHED_TOPIC' => 'Searched topic',

View file

@ -6,7 +6,7 @@
<!-- IF SEARCH_TOPIC --> <!-- IF SEARCH_TOPIC -->
<p><a class="left" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p> <p><a class="left" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
<!-- ELSE --> <!-- ELSE -->
<p><a class="left" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO} {L_SEARCH_ADV}</a></p> <p><a class="left" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER --> <!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER -->