Merge "Pass through 'helpInline' to OOUI FieldLayout and make true by default"
[lhc/web/wiklou.git] / includes / logging / ProtectLogFormatter.php
index 64ec626..02a6972 100644 (file)
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
+ * @license GPL-2.0-or-later
  * @since 1.26
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * This class formats protect log entries.
  *
@@ -146,13 +148,12 @@ class ProtectLogFormatter extends LogFormatter {
        }
 
        public function formatParametersForApi() {
-               global $wgContLang;
-
                $ret = parent::formatParametersForApi();
                if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) {
                        foreach ( $ret['details'] as &$detail ) {
                                if ( isset( $detail['expiry'] ) ) {
-                                       $detail['expiry'] = $wgContLang->formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
+                                       $detail['expiry'] = MediaWikiServices::getInstance()->getContentLanguage()->
+                                               formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
                                }
                        }
                }