MediaWiki
REL1_24
|
00001 <?php 00029 class SearchDatabase extends SearchEngine { 00033 protected $db; 00034 00039 public function __construct( DatabaseBase $db = null ) { 00040 if ( $db ) { 00041 $this->db = $db; 00042 } else { 00043 $this->db = wfGetDB( DB_SLAVE ); 00044 } 00045 } 00046 00053 protected function filter( $text ) { 00054 $lc = $this->legalSearchChars(); 00055 return trim( preg_replace( "/[^{$lc}]/", " ", $text ) ); 00056 } 00057 }