1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 05:30:38 +02:00

Merge pull request from GHSA-22m9-m3ww-53h3

* fix: check post visibility when mentioning

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* fix: `mentionsPosts` include is not used and leaks private posts

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chre: use `PostRepository`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-01-10 12:43:46 +01:00
parent 8a65ad980d
commit 132fdea659
6 changed files with 52 additions and 7 deletions

View File

@@ -91,6 +91,13 @@ class Formatter
{
$parser = $this->getParser($context);
/*
* Can be injected in tag or attribute filters by calling:
* ->addParameterByName('actor') on the filter.
* See the mentions extension's ConfigureMentions.php for an example.
*/
$parser->registeredVars['actor'] = $user;
foreach ($this->parsingCallbacks as $callback) {
$text = $callback($parser, $context, $text, $user);
}

View File

@@ -29,7 +29,7 @@ class PostRepository
* @param User|null $user
* @return Builder<Post>
*/
protected function queryVisibleTo(User $user = null)
public function queryVisibleTo(User $user = null)
{
$query = $this->query();