mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 11:52:59 +01:00
LSattr_ldap::pwdHistory: fix fatal error on time encoding.
This commit is contained in:
parent
114e3c48ac
commit
1428b5df62
1 changed files with 6 additions and 2 deletions
|
@ -89,6 +89,10 @@ class LSattr_ldap_pwdHistory extends LSattr_ldap {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$datetime = date_create_from_format('YmdHisO', $value['time']);
|
$datetime = date_create_from_format('YmdHisO', $value['time']);
|
||||||
|
if (!is_a($datetime, 'DateTime')) {
|
||||||
|
self :: log_warning($this."->encodeValue($value): Fail to create DateTime object from timestamp '".varDump($value['time'])."'.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
$datetime -> setTimezone('UTC');
|
$datetime -> setTimezone('UTC');
|
||||||
$datetime_string = $datetime -> format('YmdHisO');
|
$datetime_string = $datetime -> format('YmdHisO');
|
||||||
$datetime_string = preg_replace('/[\+\-]0000$/', 'Z', $datetime_string);
|
$datetime_string = preg_replace('/[\+\-]0000$/', 'Z', $datetime_string);
|
||||||
|
|
Loading…
Reference in a new issue