X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Forphans.php;h=d47ca43f0bead79c5bcfaeeea01f5334be17b949;hb=01cdb1762c7207bd261ad03726a88cb9afc97bfb;hp=d7decc1b45e5611be7ce7ccee156b742846bc277;hpb=925c20a9ca669c67cc44f4468d0e0f3b33b94213;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/orphans.php b/maintenance/orphans.php index d7decc1b45..d47ca43f0b 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -30,6 +30,7 @@ require_once __DIR__ . '/Maintenance.php'; +use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\IMaintainableDatabase; /** @@ -97,20 +98,19 @@ class Orphans extends Maintenance { ); $orphans = $result->numRows(); if ( $orphans > 0 ) { - global $wgContLang; - $this->output( "$orphans orphan revisions...\n" ); $this->output( sprintf( "%10s %10s %14s %20s %s\n", 'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text', 'rev_comment' ) ); + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); foreach ( $result as $row ) { $comment = $commentStore->getComment( 'rev_comment', $row )->text; if ( $comment !== '' ) { - $comment = '(' . $wgContLang->truncateForVisual( $comment, 40 ) . ')'; + $comment = '(' . $contLang->truncateForVisual( $comment, 40 ) . ')'; } - $rev_user_text = $wgContLang->truncateForVisual( $row->rev_user_text, 20 ); + $rev_user_text = $contLang->truncateForVisual( $row->rev_user_text, 20 ); # pad $rev_user_text to 20 characters. Note that this may # yield poor results if $rev_user_text contains combining # or half-width characters. Alas.