mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
strip data image base64 prefix before storing foto, show dummy profile img when foto is null in DetailsHeader
This commit is contained in:
@@ -276,14 +276,19 @@ class Student extends FHCAPI_Controller
|
||||
$update_person = array();
|
||||
foreach ($array_allowed_props_person as $prop) {
|
||||
$val = $this->input->post($prop);
|
||||
if ($val !== null)
|
||||
if ($val === null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if($prop == 'foto')
|
||||
{
|
||||
$fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
|
||||
$update_person[$prop] = $fotoval;
|
||||
}
|
||||
else
|
||||
{
|
||||
$update_person[$prop] = $val;
|
||||
}
|
||||
if($prop == 'foto' && $val == '')
|
||||
{
|
||||
$update_person[$prop] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$array_allowed_props_student = ['matrikelnr'];
|
||||
|
||||
Reference in New Issue
Block a user