dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add support for extra database connections in unit tests."
[lhc/web/wiklou.git]
/
includes
/
search
/
SearchOracle.php
diff --git
a/includes/search/SearchOracle.php
b/includes/search/SearchOracle.php
index
2e6cb84
..
7fe5b53
100644
(file)
--- a/
includes/search/SearchOracle.php
+++ b/
includes/search/SearchOracle.php
@@
-64,7
+64,7
@@
class SearchOracle extends SearchDatabase {
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
-
function s
earchText( $term ) {
+
protected function doS
earchText( $term ) {
if ( $term == '' ) {
return new SqlSearchResultSet( false, '' );
}
if ( $term == '' ) {
return new SqlSearchResultSet( false, '' );
}
@@
-79,7
+79,7
@@
class SearchOracle extends SearchDatabase {
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
-
function s
earchTitle( $term ) {
+
protected function doS
earchTitle( $term ) {
if ( $term == '' ) {
return new SqlSearchResultSet( false, '' );
}
if ( $term == '' ) {
return new SqlSearchResultSet( false, '' );
}
@@
-92,7
+92,7
@@
class SearchOracle extends SearchDatabase {
* Return a partial WHERE clause to limit the search to the given namespaces
* @return string
*/
* Return a partial WHERE clause to limit the search to the given namespaces
* @return string
*/
- function queryNamespaces() {
+
private
function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
return '';
}
if ( is_null( $this->namespaces ) ) {
return '';
}
@@
-111,7
+111,7
@@
class SearchOracle extends SearchDatabase {
*
* @return string
*/
*
* @return string
*/
- function queryLimit( $sql ) {
+
private
function queryLimit( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
}
return $this->db->limitResult( $sql, $this->limit, $this->offset );
}
@@
-134,7
+134,7
@@
class SearchOracle extends SearchDatabase {
* @param bool $fulltext
* @return string
*/
* @param bool $fulltext
* @return string
*/
- function getQuery( $filteredTerm, $fulltext ) {
+
private
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryNamespaces() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryNamespaces() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
@@
-145,7
+145,7
@@
class SearchOracle extends SearchDatabase {
* @param bool $fulltext
* @return string
*/
* @param bool $fulltext
* @return string
*/
- function getIndexField( $fulltext ) {
+
private
function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
}
return $fulltext ? 'si_text' : 'si_title';
}
@@
-172,9
+172,9
@@
class SearchOracle extends SearchDatabase {
* @param bool $fulltext
* @return string
*/
* @param bool $fulltext
* @return string
*/
- function parseQuery( $filteredText, $fulltext ) {
+
private
function parseQuery( $filteredText, $fulltext ) {
global $wgContLang;
global $wgContLang;
- $lc = $this->legalSearchChars();
+ $lc = $this->legalSearchChars(
self::CHARS_NO_SYNTAX
);
$this->searchTerms = [];
# @todo FIXME: This doesn't handle parenthetical expressions.
$this->searchTerms = [];
# @todo FIXME: This doesn't handle parenthetical expressions.
@@
-266,7
+266,11
@@
class SearchOracle extends SearchDatabase {
[] );
}
[] );
}
- public function legalSearchCharsForUpdate() {
- return "\"" . parent::legalSearchCharsForUpdate();
+ public static function legalSearchChars( $type = self::CHARS_ALL ) {
+ $searchChars = parent::legalSearchChars( $type );
+ if ( $type === self::CHARS_ALL ) {
+ $searchChars = "\"" . $searchChars;
+ }
+ return $searchChars;
}
}
}
}