1
0
mirror of https://github.com/flarum/core.git synced 2025-07-28 20:20:34 +02:00

Don't use hash in generated mention URLs

This commit is contained in:
Toby Zerner
2015-06-23 10:27:14 +09:30
parent 090e0f1e94
commit 8bdbdeb433
2 changed files with 4 additions and 2 deletions

View File

@@ -17,7 +17,8 @@ class PostMentionsFormatter extends FormatterAbstract
if ($post) {
$text = $this->ignoreTags($text, ['a', 'code', 'pre'], function ($text) use ($post) {
return $this->parser->replace($text, function ($match) use ($post) {
return '<a href="#/d/'.$post->discussion_id.'/-/'.$match['number'].'" class="mention-post" data-number="'.$match['number'].'">'.$match['username'].'</a>';
// TODO: use URL generator
return '<a href="/d/'.$post->discussion_id.'/-/'.$match['number'].'" class="mention-post" data-number="'.$match['number'].'">'.$match['username'].'</a>';
}, $text);
});
}

View File

@@ -16,7 +16,8 @@ class UserMentionsFormatter extends FormatterAbstract
{
$text = $this->ignoreTags($text, ['a', 'code', 'pre'], function ($text) {
return $this->parser->replace($text, function ($match) {
return '<a href="#/u/'.$match['username'].'" class="mention-user" data-user="'.$match['username'].'">'.$match['username'].'</a>';
// TODO: use URL generator
return '<a href="/u/'.$match['username'].'" class="mention-user" data-user="'.$match['username'].'">'.$match['username'].'</a>';
}, $text);
});