Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / EditPage.php
index 4f6b7b4..22c29d6 100644 (file)
@@ -587,6 +587,10 @@ class EditPage {
                $permErrors = $this->getEditPermissionErrors( $this->save ? 'secure' : 'full' );
                if ( $permErrors ) {
                        wfDebug( __METHOD__ . ": User can't edit\n" );
+
+                       // track block with a cookie if it doesn't exists already
+                       $this->context->getUser()->trackBlockWithCookie();
+
                        // Auto-block user's IP if the account was "hard" blocked
                        if ( !wfReadOnly() ) {
                                DeferredUpdates::addCallableUpdate( function () {
@@ -938,7 +942,7 @@ class EditPage {
                        if ( $this->incompleteForm ) {
                                # If the form is incomplete, force to preview.
                                wfDebug( __METHOD__ . ": Form data appears to be incomplete\n" );
-                               wfDebug( "POST DATA: " . var_export( $_POST, true ) . "\n" );
+                               wfDebug( "POST DATA: " . var_export( $request->getPostValues(), true ) . "\n" );
                                $this->preview = true;
                        } else {
                                $this->preview = $request->getCheck( 'wpPreview' );
@@ -1574,7 +1578,7 @@ class EditPage {
                                                $query = $query . '&' . $extraQueryRedirect;
                                        }
                                }
-                               $anchor = isset( $resultDetails['sectionanchor'] ) ? $resultDetails['sectionanchor'] : '';
+                               $anchor = $resultDetails['sectionanchor'] ?? '';
                                $out->redirect( $this->mTitle->getFullURL( $query ) . $anchor );
                                return false;
 
@@ -3537,7 +3541,7 @@ ERROR;
                // Allow for site and per-namespace customization of contribution/copyright notice.
                Hooks::run( 'EditPageCopyrightWarning', [ $title, &$copywarnMsg ] );
 
-               $msg = call_user_func_array( 'wfMessage', $copywarnMsg )->title( $title );
+               $msg = wfMessage( ...$copywarnMsg )->title( $title );
                if ( $langcode ) {
                        $msg->inLanguage( $langcode );
                }
@@ -4116,7 +4120,8 @@ ERROR;
                if ( Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) {
                        // Only add the old toolbar cruft to the page payload if the toolbar has not
                        // been over-written by a hook caller
-                       $wgOut->addScript( ResourceLoader::makeInlineScript( $script ) );
+                       $nonce = $wgOut->getCSPNonce();
+                       $wgOut->addScript( ResourceLoader::makeInlineScript( $script, $nonce ) );
                };
 
                return $toolbar;
@@ -4190,7 +4195,7 @@ ERROR;
                $checkboxesDef = $this->getCheckboxesDefinition( $checked );
 
                foreach ( $checkboxesDef as $name => $options ) {
-                       $legacyName = isset( $options['legacy-name'] ) ? $options['legacy-name'] : $name;
+                       $legacyName = $options['legacy-name'] ?? $name;
 
                        $title = null;
                        $accesskey = null;
@@ -4216,7 +4221,7 @@ ERROR;
                                        'align' => 'inline',
                                        'label' => new OOUI\HtmlSnippet( $this->context->msg( $options['label-message'] )->parse() ),
                                        'title' => $title,
-                                       'id' => isset( $options['label-id'] ) ? $options['label-id'] : null,
+                                       'id' => $options['label-id'] ?? null,
                                ]
                        );
                }