参照The username may only contain letters, numbers, and dashes 贴修改
中文用户名 @ 还是有问题。
文件修改如下:
vendor/flarum/flarum-ext-mentions/src/Listener/FormatPostMentions.php:
$configurator->Preg->match('/\B@(?<username>[-_a-zA-Z0-9-�]+$/i', $tagName);
vendor/flarum/flarum-ext-mentions/src/Listener/FormatUserMentions.php:
$configurator->Preg->match('/\B@(?<username>[-_a-zA-Z0-9-�]', $tagName);
/**
* @param $tag
* @param UserRepository $users
* @return bool
*/
public static function addId($tag, UserRepository $users)
{
if ($id = $users->getIdForUsername(rawurlencode($tag->getAttribute('username')))) {
$tag->setAttribute('id', $id);
return true;
}
}
@feixuqy @justjavac
感谢!