fixed bug to update email and name by anonymous edit.
This commit is contained in:
parent
3b3742fc2a
commit
75fc5022f0
@ -504,13 +504,11 @@ function cbsonline_wpforo_edit_topic_data_filter($args)
|
|||||||
{
|
{
|
||||||
if (!is_user_logged_in() && isset($args['name']) && isset($args['email'])) {
|
if (!is_user_logged_in() && isset($args['name']) && isset($args['email'])) {
|
||||||
$args['status'] = 0;
|
$args['status'] = 0;
|
||||||
if ($args['name'] == wpforo_phrase('Anonymous', false)) {
|
$cookie = [
|
||||||
$host = gethostbyaddr($_SERVER['REMOTE_ADDR'] ?? '127.0.0.1');
|
'name' => $args['name'],
|
||||||
if (false !== $host) {
|
'email' => $args['email'],
|
||||||
// override name to hostname if name is 'Anonymous'
|
];
|
||||||
$args['name'] = $host;
|
WPF()->member->set_guest_cookies($cookie);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $args;
|
return $args;
|
||||||
|
Loading…
Reference in New Issue
Block a user