LSform: fix call of LSformRules validate method to provide LSformElement by ref

This commit is contained in:
Benjamin Renard 2020-08-26 16:10:50 +02:00
parent 4c1c7b2fae
commit 5b9e6409f4

View file

@ -367,7 +367,7 @@ class LSform extends LSlog_staticLoggerClass {
foreach($this -> _rules[$element] as $rule) {
$ruleType="LSformRule_".$rule['name'];
LSsession :: loadLSclass($ruleType);
if (! call_user_func_array(array( $ruleType,'validate') , array($value, $rule['options'], $this -> getElement($element)))) {
if (! call_user_func_array(array( $ruleType,'validate') , array($value, $rule['options'], &$this -> elements[$element]))) {
$retval=false;
$this -> setElementError($this -> elements[$element],$rule['options']['msg']);
}