mirror of
https://github.com/humhub/humhub.git
synced 2025-04-21 07:31:53 +02:00
Fix/date profile field types (#6183)
* Fix Date and Datetime profile field type with null values on PHP 8.1+ * Update CHANGELOG.md * Avoid possible null value
This commit is contained in:
parent
53749a129e
commit
bb0d8a5f1f
@ -333,7 +333,7 @@ class LdapAuth extends BaseFormAuth implements AutoSyncUsers, SyncAttributes, Ap
|
||||
foreach ($normalized as $name => $value) {
|
||||
if (isset(Yii::$app->params['ldap']['dateFields'][$name]) && $value != '') {
|
||||
$dateFormat = Yii::$app->params['ldap']['dateFields'][$name];
|
||||
$date = DateTime::createFromFormat($dateFormat, $value);
|
||||
$date = DateTime::createFromFormat($dateFormat, $value ?? '');
|
||||
|
||||
if ($date !== false) {
|
||||
$normalized[$name] = $date->format('Y-m-d');
|
||||
|
Loading…
x
Reference in New Issue
Block a user