mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
handle boolean values explicitly
This commit is contained in:
@@ -138,19 +138,23 @@ class Prestudent extends FHCAPI_Controller
|
||||
{
|
||||
$val = $this->input->post($prop, true);
|
||||
|
||||
if ($val !== null || $prop === 'foerderrelevant') {
|
||||
if ($val !== null) {
|
||||
if(in_array($prop, ['dual', 'bismelden', 'foerderrelevant']))
|
||||
{
|
||||
$val = boolval($val);
|
||||
}
|
||||
$update_prestudent[$prop] = $val;
|
||||
}
|
||||
|
||||
//set null instead of empty string
|
||||
if ($val === '' && ($prop != 'dual' || $prop != 'bismelden')){
|
||||
// allowed to be null, but has to be in postparameter
|
||||
if (
|
||||
in_array($prop, ['foerderrelevant', 'zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
|
||||
&& !isset($update_prestudent[$prop])
|
||||
&& array_key_exists($prop, $_POST)
|
||||
)
|
||||
{
|
||||
$update_prestudent[$prop] = null;
|
||||
}
|
||||
|
||||
//set false instead of empty string if boolean
|
||||
if ($val === '' && ($prop === 'dual' || $prop === 'bismelden')) {
|
||||
$update_prestudent[$prop] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$update_prestudent['updateamum'] = date('c');
|
||||
|
||||
Reference in New Issue
Block a user