mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
WIP ViDoTeach REST API: fix not working unsetting in PATCH requests with null value
This commit is contained in:
parent
a5796c8b41
commit
5f795a4379
@ -370,6 +370,11 @@ class JsBase
|
||||
$target = $value;
|
||||
}
|
||||
}
|
||||
// if we unset fields stored directly in the database, they will NOT be updated :(
|
||||
elseif (!$n)
|
||||
{
|
||||
$target = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($parent[$part]);
|
||||
|
@ -115,6 +115,25 @@ class MimeMagic
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a MIME type to all known file extensions
|
||||
*
|
||||
* If we cannot map the type to any file extension, we return an empty array.
|
||||
*
|
||||
* @param string $_type The MIME type to be mapped to a file extension.
|
||||
* @return array with possible file extensions
|
||||
*/
|
||||
public static function mime2extensions($_type)
|
||||
{
|
||||
$type = strtolower($_type);
|
||||
if (isset(self::$mime_alias_map[$type])) $type = self::$mime_alias_map[$type];
|
||||
|
||||
return array_keys(array_filter(self::$mime_extension_map, static function($mime) use ($type)
|
||||
{
|
||||
return $mime == $type;
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix old / aliased mime-types by returning valid/default mime-type
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user