From: Joshua Rüsweg Date: Wed, 3 Jun 2020 15:01:49 +0000 (+0200) Subject: Improve condition readability X-Git-Tag: 5.3.0_Alpha_1~182^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6d1fa39668da1fbc4dacd46362eca9526640a49;p=GitHub%2FWoltLab%2FWCF.git Improve condition readability Co-authored-by: Tim Düsterhus --- diff --git a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php index 4b7c079439..b05d1e8691 100644 --- a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php +++ b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php @@ -130,7 +130,7 @@ class EmailActivationForm extends AbstractForm { * @inheritDoc */ public function show() { - if (!(REGISTER_ACTIVATION_METHOD & 1)) { + if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) { throw new IllegalLinkException(); } diff --git a/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php b/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php index be803ec619..1e301270c6 100644 --- a/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterActivationForm.class.php @@ -104,7 +104,7 @@ class RegisterActivationForm extends AbstractForm { $this->saved(); // forward to index page - if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN && !$this->user->isActivated()) { + if ((REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) && !$this->user->isActivated()) { $redirectText = WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success.awaitAdminActivation'); } else { diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index ded41b4346..62782b5ecf 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -429,7 +429,7 @@ class RegisterForm extends UserAddForm { // generate activation code $addDefaultGroups = true; - if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) { + if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN)) { $activationCode = UserRegistrationUtil::getActivationCode(); $emailConfirmCode = bin2hex(\random_bytes(20)); $this->additionalFields['activationCode'] = $activationCode;