X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchDatabase.php;h=643c2c13648dc4381f538aa8f21bf4462957be6d;hb=36395150104588f2afea866c330b683e4329fa48;hp=38c60d0bec74cd254c5000e184278bdad842d069;hpb=939199bcea28a3b13c49c0f808d11d415660b924;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchDatabase.php b/includes/search/SearchDatabase.php index 38c60d0bec..643c2c1364 100644 --- a/includes/search/SearchDatabase.php +++ b/includes/search/SearchDatabase.php @@ -21,6 +21,8 @@ * @ingroup Search */ +use Wikimedia\Rdbms\IDatabase; + /** * Base search engine base class for database-backed searches * @ingroup Search @@ -33,7 +35,6 @@ class SearchDatabase extends SearchEngine { protected $db; /** - * Constructor * @param IDatabase $db The database to search from */ public function __construct( IDatabase $db = null ) { @@ -51,7 +52,10 @@ class SearchDatabase extends SearchEngine { * @return string */ protected function filter( $text ) { - $lc = $this->legalSearchChars(); + // List of chars allowed in the search query. + // This must include chars used in the search syntax. + // Usually " (phrase) or * (wildcards) if supported by the engine + $lc = $this->legalSearchChars( self::CHARS_ALL ); return trim( preg_replace( "/[^{$lc}]/", " ", $text ) ); } }