Use short assignment operator in PHP
[lhc/web/wiklou.git] / includes / EditPage.php
index 400ea47..2048b87 100644 (file)
@@ -689,7 +689,7 @@ class EditPage {
                # that edit() already checked just in case someone tries to sneak
                # in the back door with a hand-edited submission URL.
 
-               if ( 'save' == $this->formtype ) {
+               if ( $this->formtype == 'save' ) {
                        $resultDetails = null;
                        $status = $this->attemptSave( $resultDetails );
                        if ( !$this->handleStatus( $status, $resultDetails ) ) {
@@ -699,7 +699,7 @@ class EditPage {
 
                # First time through: get contents, set time for conflict
                # checking, etc.
-               if ( 'initial' == $this->formtype || $this->firsttime ) {
+               if ( $this->formtype == 'initial' || $this->firsttime ) {
                        if ( $this->initialiseForm() === false ) {
                                $out = $this->context->getOutput();
                                if ( $out->getRedirect() === '' ) { // mcrundo hack redirects, don't override it
@@ -1670,7 +1670,7 @@ class EditPage {
                                        if ( $query === '' ) {
                                                $query = $extraQueryRedirect;
                                        } else {
-                                               $query = $query . '&' . $extraQueryRedirect;
+                                               $query .= '&' . $extraQueryRedirect;
                                        }
                                }
                                $anchor = $resultDetails['sectionanchor'] ?? '';
@@ -1698,7 +1698,7 @@ class EditPage {
                                        if ( $extraQuery === '' ) {
                                                $extraQuery = $extraQueryRedirect;
                                        } else {
-                                               $extraQuery = $extraQuery . '&' . $extraQueryRedirect;
+                                               $extraQuery .= '&' . $extraQueryRedirect;
                                        }
                                }
 
@@ -2863,7 +2863,7 @@ ERROR;
                // Put these up at the top to ensure they aren't lost on early form submission
                $this->showFormBeforeText();
 
-               if ( $this->wasDeletedSinceLastEdit() && 'save' == $this->formtype ) {
+               if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) {
                        $username = $this->lastDelete->user_name;
                        $comment = CommentStore::getStore()
                                ->getComment( 'log_comment', $this->lastDelete )->text;
@@ -3250,15 +3250,13 @@ ERROR;
         * @return array
         */
        private function getSummaryInputAttributes( array $inputAttrs = null ) {
-               $conf = $this->context->getConfig();
-               $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
                // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
                // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
-               // Unicode codepoints (or 255 UTF-8 bytes for old schema).
+               // Unicode codepoints.
                return ( is_array( $inputAttrs ) ? $inputAttrs : [] ) + [
                        'id' => 'wpSummary',
                        'name' => 'wpSummary',
-                       'maxlength' => $oldCommentSchema ? 200 : CommentStore::COMMENT_CHARACTER_LIMIT,
+                       'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT,
                        'tabindex' => 1,
                        'size' => 60,
                        'spellcheck' => 'true',