From 531991a1e5caa7b9c1b522b8669d50dfa04768d9 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 19 Jul 2021 16:47:20 +0200 Subject: [PATCH] LSform/LSformRule: Handle rule without options or message --- src/includes/class/class.LSattribute.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/includes/class/class.LSattribute.php b/src/includes/class/class.LSattribute.php index 925be7bf..0c6f93d0 100644 --- a/src/includes/class/class.LSattribute.php +++ b/src/includes/class/class.LSattribute.php @@ -253,6 +253,11 @@ class LSattribute extends LSlog_staticLoggerClass { $check_data = $this -> getConfig('check_data', array()); if(is_array($check_data)) { foreach ($check_data as $rule => $rule_options) { + // Handle rule without options or message + if (is_int($rule) && is_string($rule_options)) { + $rule = $rule_options; + $rule_options = array(); + } // Check rule if(!is_empty($rule) && !$form -> isRuleRegistered($rule)) { LSerror :: addErrorCode('LSattribute_03', array('attr' => $this->name, 'rule' => $rule));