mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:50:11 +00:00
Ensure that the actor name can't be changed
This commit is contained in:
parent
b12a2c486e
commit
6fd0848cde
2 changed files with 10 additions and 2 deletions
|
@ -175,6 +175,14 @@ class User
|
|||
{
|
||||
$system_actor_name = DI::config()->get('system', 'actor_name');
|
||||
if (!empty($system_actor_name)) {
|
||||
$self = Contact::selectFirst(['nick'], ['uid' => 0, 'self' => true]);
|
||||
if (!empty($self['nick'])) {
|
||||
if ($self['nick'] != $system_actor_name) {
|
||||
// Reset the actor name to the already used name
|
||||
DI::config()->set('system', 'actor_name', $self['nick']);
|
||||
$system_actor_name = $self['nick'];
|
||||
}
|
||||
}
|
||||
return $system_actor_name;
|
||||
}
|
||||
|
||||
|
@ -680,7 +688,6 @@ class User
|
|||
{
|
||||
$forbidden_nicknames = DI::config()->get('system', 'forbidden_nicknames', '');
|
||||
if (!empty($forbidden_nicknames)) {
|
||||
// check if the nickname is in the list of blocked nicknames
|
||||
$forbidden = explode(',', $forbidden_nicknames);
|
||||
$forbidden = array_map('trim', $forbidden);
|
||||
} else {
|
||||
|
@ -697,6 +704,7 @@ class User
|
|||
return false;
|
||||
}
|
||||
|
||||
// check if the nickname is in the list of blocked nicknames
|
||||
if (in_array(strtolower($nickname), $forbidden)) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue