mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
Enhancement of method _validate of controller Person
This commit is contained in:
@@ -123,7 +123,10 @@ class Person extends APIv1_Controller
|
|||||||
// Trim all the values
|
// Trim all the values
|
||||||
foreach($person as $key => $value)
|
foreach($person as $key => $value)
|
||||||
{
|
{
|
||||||
$person[$key] = trim($value);
|
if (gettype($value) == 'string')
|
||||||
|
{
|
||||||
|
$person[$key] = trim($value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($person['sprache']) && mb_strlen($person['sprache']) > 16)
|
if (isset($person['sprache']) && mb_strlen($person['sprache']) > 16)
|
||||||
@@ -182,7 +185,7 @@ class Person extends APIv1_Controller
|
|||||||
{
|
{
|
||||||
return error('Anzahl der Kinder ist ungueltig');
|
return error('Anzahl der Kinder ist ungueltig');
|
||||||
}
|
}
|
||||||
if (!isset($person['aktiv']) || (isset($person['aktiv']) && $person['aktiv'] !== 'true' && $person['aktiv'] !== 'false'))
|
if (!isset($person['aktiv']) || (isset($person['aktiv']) && $person['aktiv'] !== true && $person['aktiv'] !== false))
|
||||||
{
|
{
|
||||||
return error('Aktiv ist ungueltig');
|
return error('Aktiv ist ungueltig');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user