From b3791b28ec57133fe0018e36d0c794083e6a2637 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 31 May 2017 16:05:25 +0200 Subject: [PATCH] LSformElement_select : fix bug when possible_values params is unset or empty --- .../includes/class/class.LSformElement_select.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public_html/includes/class/class.LSformElement_select.php b/public_html/includes/class/class.LSformElement_select.php index 3f2c3ec5..ac06b062 100644 --- a/public_html/includes/class/class.LSformElement_select.php +++ b/public_html/includes/class/class.LSformElement_select.php @@ -72,8 +72,14 @@ class LSformElement_select extends LSformElement { * @retval string or False The value's label or False if this value is incorrect */ public function isValidValue($value,$possible_values=False) { - if (!$possible_values) - $possible_values=$this -> params['text_possible_values']; + if (!is_array($possible_values)) { + if (isset($this) && get_class($this) == __CLASS__ && is_array($this -> params['text_possible_values'])) { + $possible_values=$this -> params['text_possible_values']; + } + else { + return False; + } + } $ret=False; if (is_array($possible_values) && isset($value)) {