Migrate doubleredirect and brokenredirect subpages from SpecialMaintenance.php to...
[lhc/web/wiklou.git] / includes / SearchUpdate.php
index c7b9c61..9cbbb61 100644 (file)
@@ -25,19 +25,22 @@ class SearchUpdate {
 
        function doUpdate()
        {
-               global $wgDBminWordLen, $wgLang, $wgDisableSearchUpdate, $wgIsMySQL;
+               global $wgDBminWordLen, $wgLang, $wgDisableSearchUpdate;
 
                if( $wgDisableSearchUpdate || !$this->mId ) {
                        return false;
                }
                $lc = SearchEngine::legalSearchChars() . "&#;";
+               $db =& wfGetDB( DB_MASTER );
+               $searchindex = $db->tableName( 'searchindex' );
+               
                if( $this->mText == false ) {
                        # Just update the title
-                       $lowpri=$wgIsMySQL?"LOW_PRIORITY":"";
-                       $sql = "UPDATE $lowpri searchindex SET si_title='" .
-                         wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) .
+                       $lowpri = $db->lowPriorityOption();
+                       $sql = "UPDATE $lowpri $searchindex SET si_title='" .
+                         $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) .
                          "' WHERE si_page={$this->mId}";
-                       wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" );
+                       $db->query( $sql, "SearchUpdate::doUpdate" );
                        return;
                }
 
@@ -77,10 +80,10 @@ class SearchUpdate {
                # Strip wiki '' and '''
                $text = preg_replace( "/''[']*/", " ", $text );
                
-               $sql = "REPLACE  INTO searchindex (si_page,si_title,si_text) VALUES ({$this->mId},'" .
-                 wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "','" .
-                 wfStrencode( $text ) . "')";
-               wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" );
+               $sql = "REPLACE  INTO $searchindex (si_page,si_title,si_text) VALUES ({$this->mId},'" .
+                 $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "','" .
+                 $db->strencode( $text ) . "')";
+               $db->query( $sql, "SearchUpdate::doUpdate" );
        }
 }