mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
Trim unicode spaces on imported name field.
This commit is contained in:
parent
7c4763e8ed
commit
d2e0143ace
2 changed files with 5 additions and 1 deletions
|
@ -2197,7 +2197,7 @@ class Activity
|
|||
// store the actor record in XConfig
|
||||
XConfig::Set($url, 'system', 'actor_record', $person_obj);
|
||||
|
||||
$name = escape_tags($person_obj['name']);
|
||||
$name = unicode_trim(escape_tags($person_obj['name']));
|
||||
if (!$name) {
|
||||
$name = escape_tags($person_obj['preferredUsername']);
|
||||
}
|
||||
|
|
|
@ -4165,3 +4165,7 @@ function wildmat($pattern, $string)
|
|||
{
|
||||
return preg_match("#^" . strtr(preg_quote($pattern, '#'), [ '\*' => '.*', '\?' => '.', '\[' => '[', '\]' => ']' ]) . "$#i", $string);
|
||||
}
|
||||
|
||||
function unicode_trim($s) {
|
||||
return preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $s);
|
||||
}
|
Loading…
Reference in a new issue