From b6f0605dac6b1b1df516bcc2eb90208b249d3dcb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 1 Jul 2019 18:19:58 +0200 Subject: [PATCH] LSform_rule :: differentPassword : Add missing LSform :: getValue() function --- public_html/includes/class/class.LSform.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/public_html/includes/class/class.LSform.php b/public_html/includes/class/class.LSform.php index f4c1a7fe..099be618 100644 --- a/public_html/includes/class/class.LSform.php +++ b/public_html/includes/class/class.LSform.php @@ -615,6 +615,23 @@ class LSform { return $this -> elements[$element]; } + /** + * Return the values of an element + * + * If form is posted, retreive values from postData, otherwise + * retreive value from the element. + * + * @param[in] string $element The element name + * + * @retval mixed The element values + **/ + public function getValue($element) { + if ($this -> isSubmit() && $this -> _postData) { + return $this -> _postData[$element]; + } + return $this -> elements[$element] -> getValue(); + } + /** * Défini les valeurs des élements à partir des valeurs postées *