X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupWatchlist.php;h=8e4a353df8c4a1d846e26815e5b74c7fb46f9d6e;hb=01cdb1762c7207bd261ad03726a88cb9afc97bfb;hp=64d39dd6c88565c750533be714a7192b5b5ebd0e;hpb=ee3147729028e025b177ff459a2f1670aef8a247;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupWatchlist.php b/maintenance/cleanupWatchlist.php index 64d39dd6c8..8e4a353df8 100644 --- a/maintenance/cleanupWatchlist.php +++ b/maintenance/cleanupWatchlist.php @@ -29,6 +29,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/cleanupTable.inc'; /** @@ -36,7 +38,7 @@ require_once __DIR__ . '/cleanupTable.inc'; * * @ingroup Maintenance */ -class WatchlistCleanup extends TableCleanup { +class CleanupWatchlist extends TableCleanup { protected $defaultParams = [ 'table' => 'watchlist', 'index' => [ 'wl_user', 'wl_namespace', 'wl_title' ], @@ -58,10 +60,9 @@ class WatchlistCleanup extends TableCleanup { } protected function processRow( $row ) { - global $wgContLang; $current = Title::makeTitle( $row->wl_namespace, $row->wl_title ); $display = $current->getPrefixedText(); - $verified = $wgContLang->normalize( $display ); + $verified = MediaWikiServices::getInstance()->getContentLanguage()->normalize( $display ); $title = Title::newFromText( $verified ); if ( $row->wl_user == 0 || is_null( $title ) || !$title->equals( $current ) ) { @@ -95,5 +96,5 @@ class WatchlistCleanup extends TableCleanup { } } -$maintClass = WatchlistCleanup::class; +$maintClass = CleanupWatchlist::class; require_once RUN_MAINTENANCE_IF_MAIN;