SpecialRevisiondelete: Simplify if/elseif logic
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 26 May 2014 18:21:10 +0000 (20:21 +0200)
committerKrinkle <krinklemail@gmail.com>
Tue, 27 May 2014 05:05:03 +0000 (05:05 +0000)
This avoids checking $comment twice
by Krinkle on I3b21f66f84d68777a18e66e4e5f59886e55d7936

Change-Id: I39df27d3edb097024d136455145505429ccdbe39

includes/specials/SpecialRevisiondelete.php

index 797f588..d3b168b 100644 (file)
@@ -572,12 +572,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                // from dropdown
                $listReason = $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' );
                $comment = $listReason;
-               if ( $comment != 'other' && $this->otherReason != '' ) {
+               if ( $comment === 'other' ) {
+                       $comment = $this->otherReason;
+               } elseif ( $this->otherReason !== '' ) {
                        // Entry from drop down menu + additional comment
                        $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
                                . $this->otherReason;
-               } elseif ( $comment == 'other' ) {
-                       $comment = $this->otherReason;
                }
                # Can the user set this field?
                if ( $bitParams[Revision::DELETED_RESTRICTED] == 1