Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / includes / ProtectionForm.php
index 70192b9..53608e8 100644 (file)
@@ -22,6 +22,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Handles the page protection UI and backend
@@ -70,7 +71,9 @@ class ProtectionForm {
                // Check if the form should be disabled.
                // If it is, the form will be available in read-only to show levels.
                $this->mPermErrors = $this->mTitle->getUserPermissionsErrors(
-                       'protect', $this->mContext->getUser()
+                       'protect',
+                       $this->mContext->getUser(),
+                       $this->mContext->getRequest()->wasPosted() ? 'secure' : 'full' // T92357
                );
                if ( wfReadOnly() ) {
                        $this->mPermErrors[] = [ 'readonlytext', wfReadOnlyReason() ];
@@ -146,7 +149,7 @@ class ProtectionForm {
         *
         * @param string $action
         *
-        * @return string 14-char timestamp or "infinity", or false if the input was invalid
+        * @return string|false 14-char timestamp or "infinity", or false if the input was invalid
         */
        function getExpiry( $action ) {
                if ( $this->mExpirySelection[$action] == 'existing' ) {
@@ -541,9 +544,10 @@ class ProtectionForm {
                $out .= Xml::closeElement( 'fieldset' );
 
                if ( $user->isAllowed( 'editinterface' ) ) {
-                       $link = Linker::linkKnown(
+                       $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
+                       $link = $linkRenderer->makeKnownLink(
                                $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(),
-                               $context->msg( 'protect-edit-reasonlist' )->escaped(),
+                               $context->msg( 'protect-edit-reasonlist' )->text(),
                                [],
                                [ 'action' => 'edit' ]
                        );
@@ -612,7 +616,7 @@ class ProtectionForm {
        /**
         * Show protection long extracts for this page
         *
-        * @param OutputPage $out
+        * @param OutputPage &$out
         * @access private
         */
        function showLogExtract( &$out ) {