Fixed Bug in includes\ui\ui_input.inc
[fa-stable.git] / includes / ui / ui_input.inc
index 2a4d75fd308c154c6475b84a440807bd4ff9af9f..448bd8f408eb264a1cbfdb60829a8e8451efdaca 100644 (file)
@@ -347,9 +347,7 @@ function select_button_cell($name, $value, $title=false)
 
 function check_value($name)
 {
-    if (!isset($_POST[$name]) || ($_POST[$name]+0) === 0)
-               return 0;
-       return 1;
+    return (empty($_POST[$name]) ? 0 : 1);
 }
 
 function checkbox($label, $name, $value=null, $submit_on_change=false, $title=false)
@@ -728,7 +726,7 @@ function ref_cells($label, $name, $title=null, $init=null, $params=null, $submit
                if (empty($_POST[$name.'_list'])) // restore refline id
                        $_POST[$name.'_list'] = $Refs->reflines->find_refline_id(empty($_POST[$name]) ? $init : $_POST[$name], $type);
 
-               if (empty($_POST[$name]) || ($_SERVER['REQUEST_METHOD'] == 'GET')) // initialization
+               if (empty($_POST[$name])) // initialization
                {
                        if (isset($init))
                        {
@@ -740,7 +738,7 @@ function ref_cells($label, $name, $title=null, $init=null, $params=null, $submit
                }
 
                if (check_ui_refresh($name)) { // call context changed
-                       $_POST[$name] = $Refs->normalize($init, $type, $context, $_POST[$name.'_list']);
+                       $_POST[$name] = $Refs->normalize($_POST[$name], $type, $context, $_POST[$name.'_list']);
                        $Ajax->addUpdate(true, $name, $_POST[$name]);
                }