X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchMssql.php;h=5e8fb044b648d13f2ea6b24c0321853606f4613e;hb=9987c2274d2f9051f32053d9354810acce91d3f7;hp=0d1663f1f4fbb3ad4fc4390fd0a3556d15a545c1;hpb=05b8af8b91dac965c67571668187d1dc2511ae03;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchMssql.php b/includes/search/SearchMssql.php index 0d1663f1f4..5e8fb044b6 100644 --- a/includes/search/SearchMssql.php +++ b/includes/search/SearchMssql.php @@ -34,10 +34,7 @@ class SearchMssql extends SearchDatabase { * @access public */ function searchText( $term ) { - $resultSet = $this->db->resultObject( - $this->db->query( $this->getQuery( $this->filter( $term ), true ) ) - ); - + $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), true ) ); return new SqlSearchResultSet( $resultSet, $this->searchTerms ); } @@ -49,10 +46,7 @@ class SearchMssql extends SearchDatabase { * @access public */ function searchTitle( $term ) { - $resultSet = $this->db->resultObject( - $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) - ); - + $resultSet = $this->db->query( $this->getQuery( $this->filter( $term ), false ) ); return new SqlSearchResultSet( $resultSet, $this->searchTerms ); } @@ -85,6 +79,8 @@ class SearchMssql extends SearchDatabase { * Does not do anything for generic search engine * subclasses may define this though * + * @param string $filteredTerm + * @param bool $fulltext * @return string */ function queryRanking( $filteredTerm, $fulltext ) { @@ -134,16 +130,18 @@ class SearchMssql extends SearchDatabase { } /** @todo document + * @param string $filteredText + * @param bool $fulltext * @return string */ function parseQuery( $filteredText, $fulltext ) { global $wgContLang; $lc = $this->legalSearchChars(); - $this->searchTerms = array(); + $this->searchTerms = []; # @todo FIXME: This doesn't handle parenthetical expressions. - $m = array(); - $q = array(); + $m = []; + $q = []; if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', $filteredText, $m, PREG_SET_ORDER ) ) { @@ -162,7 +160,7 @@ class SearchMssql extends SearchDatabase { } } - $searchon = $this->db->addQuotes( join( ',', $q ) ); + $searchon = $this->db->addQuotes( implode( ',', $q ) ); $field = $this->getIndexField( $fulltext ); return "$field, $searchon"; }