Update IPSet use statements
[lhc/web/wiklou.git] / maintenance / cleanupTitles.php
index ccc6406..24d6d86 100644 (file)
@@ -25,6 +25,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\MediaWikiServices;
+
 require_once __DIR__ . '/cleanupTable.inc';
 
 /**
@@ -130,8 +132,11 @@ class TitleCleanup extends TableCleanup {
         * @param object $row
         * @param Title $title
         */
-       protected function moveInconsistentPage( $row, $title ) {
-               if ( $title->exists() || $title->getInterwiki() || !$title->canExist() ) {
+       protected function moveInconsistentPage( $row, Title $title ) {
+               if ( $title->exists( Title::GAID_FOR_UPDATE )
+                       || $title->getInterwiki()
+                       || !$title->canExist()
+               ) {
                        if ( $title->getInterwiki() || !$title->canExist() ) {
                                $prior = $title->getPrefixedDBkey();
                        } else {
@@ -160,7 +165,7 @@ class TitleCleanup extends TableCleanup {
                        $title = $verified;
                }
                if ( is_null( $title ) ) {
-                       $this->error( "Something awry; empty title.", true );
+                       $this->fatalError( "Something awry; empty title." );
                }
                $ns = $title->getNamespace();
                $dest = $title->getDBkey();
@@ -179,7 +184,7 @@ class TitleCleanup extends TableCleanup {
                                ],
                                [ 'page_id' => $row->page_id ],
                                __METHOD__ );
-                       LinkCache::singleton()->clear();
+                       MediaWikiServices::getInstance()->getLinkCache()->clear();
                }
        }
 }