X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLCheckField.php;h=0a1024c4b1062f4eb36712d916a5a083ec6c03a8;hb=a5230acd936b5b9270037c35b9d2d419f4c8d9a6;hp=7523b5fe84e33a8aca0e6331b54173e9bd525b0f;hpb=e554e9522693ceedd35684fd5be59d76ed5a2c65;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLCheckField.php b/includes/htmlform/fields/HTMLCheckField.php index 7523b5fe84..0a1024c4b1 100644 --- a/includes/htmlform/fields/HTMLCheckField.php +++ b/includes/htmlform/fields/HTMLCheckField.php @@ -116,11 +116,10 @@ class HTMLCheckField extends HTMLFormField { public function loadDataFromRequest( $request ) { $invert = isset( $this->mParams['invert'] ) && $this->mParams['invert']; - // GetCheck won't work like we want for checks. // Fetch the value in either one of the two following case: - // - we have a valid submit attempt (form was just submitted, or a GET URL forged by the user) - // - checkbox name has a value (false or true), ie is not null - if ( $this->isSubmitAttempt( $request ) || $request->getVal( $this->mName ) !== null ) { + // - we have a valid submit attempt (form was just submitted) + // - we have a value (an URL manually built by the user, or GET form with no wpFormIdentifier) + if ( $this->isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) { return $invert ? !$request->getBool( $this->mName ) : $request->getBool( $this->mName );