Update User Model (#1396)

Current GDPR compliant Private Name attribute is not compatible with multi byte strings, and when encountered it fails and returns an empty string for the name_private attribute.

`substr($last_name, 0, 1)` or just `$last_name[0]` is not multi byte compatible, therefore only solution is to use `mb_substr`.

It also supports encoding definitions like `mb_substr($last_name, 0, 1, 'UTF-8')`

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
This commit is contained in:
B.Fatih KOZ
2022-02-08 00:10:58 +03:00
committed by GitHub
parent 08624042f2
commit c518175244

View File

@@ -151,7 +151,7 @@ class User extends Authenticatable
$first_name = $name_parts[0];
$last_name = $name_parts[$count - 1];
return $first_name.' '.$last_name[0];
return $first_name.' '.mb_substr($last_name, 0, 1);
}
/**