From: umherirrender Date: Mon, 26 May 2014 18:21:10 +0000 (+0200) Subject: SpecialRevisiondelete: Simplify if/elseif logic X-Git-Tag: 1.31.0-rc.0~15581^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=46ff5726c6e5be1ee73fd5a988f92c1e61b1bfc3;p=lhc%2Fweb%2Fwiklou.git SpecialRevisiondelete: Simplify if/elseif logic This avoids checking $comment twice by Krinkle on I3b21f66f84d68777a18e66e4e5f59886e55d7936 Change-Id: I39df27d3edb097024d136455145505429ccdbe39 --- diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 797f588a0d..d3b168b35b 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -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