* 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.
*
}
public function formatParametersForApi() {
- global $wgContLang;
-
$ret = parent::formatParametersForApi();
if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) {
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
foreach ( $ret['details'] as &$detail ) {
if ( isset( $detail['expiry'] ) ) {
- $detail['expiry'] = $wgContLang->formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
+ $detail['expiry'] = $contLang->
+ formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' );
}
}
}