From: Bartosz DziewoƄski Date: Wed, 10 Jan 2018 22:12:18 +0000 (+0100) Subject: SpecialProtectedtitles: Use 'comma-separator' instead of hardcoded comma X-Git-Tag: 1.31.0-rc.0~915 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=9ac82242a5f40f96f1681b2d605b8fd7b4f61a0c;p=lhc%2Fweb%2Fwiklou.git SpecialProtectedtitles: Use 'comma-separator' instead of hardcoded comma Also simplify the code. Change-Id: Ib3914b618ba3a7f1fd3e9df5527653a28c3e4ef9 --- diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index fa9033cb31..af2b81f152 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -85,10 +85,8 @@ class SpecialProtectedtitles extends SpecialPage { } $link = $this->getLinkRenderer()->makeLink( $title ); - $description_items = []; // Messages: restriction-level-sysop, restriction-level-autoconfirmed - $protType = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped(); - $description_items[] = $protType; + $description = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped(); $lang = $this->getLanguage(); $expiry = strlen( $row->pt_expiry ) ? $lang->formatExpiry( $row->pt_expiry, TS_MW ) : @@ -96,7 +94,7 @@ class SpecialProtectedtitles extends SpecialPage { if ( $expiry !== 'infinity' ) { $user = $this->getUser(); - $description_items[] = $this->msg( + $description .= $this->msg( 'comma-separator' )->escaped() . $this->msg( 'protect-expiring-local', $lang->userTimeAndDate( $expiry, $user ), $lang->userDate( $expiry, $user ), @@ -104,8 +102,7 @@ class SpecialProtectedtitles extends SpecialPage { )->escaped(); } - // @todo i18n: This should use a comma separator instead of a hard coded comma, right? - return '
  • ' . $lang->specialList( $link, implode( $description_items, ', ' ) ) . "
  • \n"; + return '
  • ' . $lang->specialList( $link, $description ) . "
  • \n"; } /**