From a745a87216fe16a456917ec2e5bb11972d7762cc Mon Sep 17 00:00:00 2001 From: Func Date: Sun, 20 Feb 2022 15:14:50 +0000 Subject: htmlform: Replace some uses of isHidden to isDisabled After its logic is refactored, we have more faith to use isDisabled() in these cases, which matches the original semantics of isHidden(). Change-Id: I1aece7c691307ac8bb3770e6dc4b8e2877e4d65c --- includes/htmlform/HTMLFormField.php | 2 +- includes/htmlform/fields/HTMLFormFieldCloner.php | 2 +- includes/htmlform/fields/HTMLRestrictionsField.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'includes/htmlform') diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 01a6ac1e45e1..97fdf718b2b1 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -395,7 +395,7 @@ abstract class HTMLFormField { * false to fail validation without displaying an error. */ public function validate( $value, $alldata ) { - if ( $this->isHidden( $alldata ) ) { + if ( $this->isDisabled( $alldata ) ) { return true; } diff --git a/includes/htmlform/fields/HTMLFormFieldCloner.php b/includes/htmlform/fields/HTMLFormFieldCloner.php index 8ae114548e92..5309b4369b1a 100644 --- a/includes/htmlform/fields/HTMLFormFieldCloner.php +++ b/includes/htmlform/fields/HTMLFormFieldCloner.php @@ -351,7 +351,7 @@ class HTMLFormFieldCloner extends HTMLFormField { if ( !array_key_exists( $fieldname, $value ) ) { continue; } - if ( $field->isHidden( $alldata ) ) { + if ( $field->isDisabled( $alldata ) ) { continue; } $ok = $field->validate( $value[$fieldname], $alldata ); diff --git a/includes/htmlform/fields/HTMLRestrictionsField.php b/includes/htmlform/fields/HTMLRestrictionsField.php index 7ba698190346..ffdc72bbdace 100644 --- a/includes/htmlform/fields/HTMLRestrictionsField.php +++ b/includes/htmlform/fields/HTMLRestrictionsField.php @@ -73,7 +73,7 @@ class HTMLRestrictionsField extends HTMLTextAreaField { * false to fail validation without displaying an error. */ public function validate( $value, $alldata ) { - if ( $this->isHidden( $alldata ) ) { + if ( $this->isDisabled( $alldata ) ) { return true; } -- cgit v1.2.3