bug 15849 - Trying to move a page onto an interwiki page produces an inappropriate...
[lhc/web/wiklou.git] / maintenance / purgeOldText.inc
index 9e6ee7a..e41c374 100644 (file)
@@ -3,15 +3,15 @@
 /**
  * Support functions for cleaning up redundant text records
  *
- * @package MediaWiki
- * @subpackage Maintenance
+ * @file
+ * @ingroup Maintenance
  * @author Rob Church <robchur@gmail.com>
  */
 
 function PurgeRedundantText( $delete = false ) {
        
        # Data should come off the master, wrapped in a transaction
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
        $dbw->begin();
        
        $tbl_arc = $dbw->tableName( 'archive' );
@@ -37,7 +37,8 @@ function PurgeRedundantText( $delete = false ) {
        # Get the IDs of all text records not in these sets
        echo( "Searching for inactive text records..." );
        $set = implode( ', ', $cur );
-       $res = $dbw->query( "SELECT old_id FROM $tbl_text WHERE old_id NOT IN ( $set )" );
+       $res = $dbw->query( "SELECT old_id FROM $tbl_txt WHERE old_id NOT IN ( $set )" );
+       $old = array();
        while( $row = $dbw->fetchObject( $res ) ) {
                $old[] = $row->old_id;
        }
@@ -59,5 +60,3 @@ function PurgeRedundantText( $delete = false ) {
        $dbw->commit();
        
 }
-
-?>
\ No newline at end of file