mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 08:19:45 +01:00
do NOT stall for somehow invalid date(time) values: log it and return empty
This commit is contained in:
parent
4caa637bd1
commit
b1c3b07c45
@ -106,7 +106,6 @@ class Date extends Transformer
|
||||
/**
|
||||
* Put date in the proper format for sending to client
|
||||
* @param string|int $value
|
||||
* @param string $format
|
||||
*/
|
||||
public function format_date($value)
|
||||
{
|
||||
@ -129,7 +128,15 @@ class Date extends Transformer
|
||||
}
|
||||
else
|
||||
{
|
||||
$date = new Api\DateTime($value);
|
||||
try {
|
||||
$date = new Api\DateTime($value);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
// do NOT stall for somehow invalid values: log it and return empty
|
||||
$e->details = $this->id.': '.json_encode($value);
|
||||
_egw_log_exception($e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (in_array($this->type, ['et2-date-timeonly', 'date-timeonly']) && $date)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user