X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialLockdb.php;h=c7c45b5510794bfc56f86363efe94eb44618f3bf;hb=e75daacd8e210b5699120c00a1fa0e0548faf967;hp=fb04b90baea56f766a3b783d42d58bf6fab42f6b;hpb=967a96e7fa5910f8fc451590decb381dbfb481ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index fb04b90bae..c7c45b5510 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -21,6 +21,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * A form to make the database readonly (eg for maintenance purposes). * @@ -74,8 +76,6 @@ class SpecialLockdb extends FormSpecialPage { } public function onSubmit( array $data ) { - global $wgContLang; - if ( !$data['Confirm'] ) { return Status::newFatal( 'locknoconfirm' ); } @@ -84,7 +84,7 @@ class SpecialLockdb extends FormSpecialPage { $fp = fopen( $this->getConfig()->get( 'ReadOnlyFile' ), 'w' ); Wikimedia\restoreWarnings(); - if ( false === $fp ) { + if ( $fp === false ) { # This used to show a file not found error, but the likeliest reason for fopen() # to fail at this point is insufficient permission to write to the file...good old # is_writable() is plain wrong in some cases, it seems... @@ -92,10 +92,11 @@ class SpecialLockdb extends FormSpecialPage { } fwrite( $fp, $data['Reason'] ); $timestamp = wfTimestampNow(); + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); fwrite( $fp, "\n

" . $this->msg( 'lockedbyandtime', $this->getUser()->getName(), - $wgContLang->date( $timestamp, false, false ), - $wgContLang->time( $timestamp, false, false ) + $contLang->date( $timestamp, false, false ), + $contLang->time( $timestamp, false, false ) )->inContentLanguage()->text() . "

\n" ); fclose( $fp );