Skip to content

Commit

Permalink
[K6.3] Preventing new users from pasting URLs and images into their
Browse files Browse the repository at this point in the history
messages or profile also affects admins and mods #9742
  • Loading branch information
xillibit committed Sep 15, 2024
1 parent fe47465 commit 1fffba2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,8 @@ protected function before()
$this->editorType = $this->ktemplate->params->get('editorType');

$this->UserCanPostImage = true;

if ($this->config->new_users_prevent_post_url_images && $this->me->posts < $this->config->minimal_user_posts_add_url_image) {
$this->UserCanPostImage = false;
}

$this->UserCanPostImage = $this->me->checkUserAllowedLinksImages();

/** @var HtmlDocument $doc */
$this->doc = $this->app->getDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ protected function before()

$this->UserCanPostImage = true;

if ($this->config->new_users_prevent_post_url_images && $this->me->posts < $this->config->minimal_user_posts_add_url_image) {
$this->UserCanPostImage = false;
}
$this->UserCanPostImage = $this->me->checkUserAllowedLinksImages();

/** @var HtmlDocument $doc */
$this->doc = $this->app->getDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ protected function before()

$this->UserCanPostImage = true;

if ($this->config->new_users_prevent_post_url_images && $this->me->posts < $this->config->minimal_user_posts_add_url_image) {
$this->UserCanPostImage = false;
}
$this->UserCanPostImage = $this->me->checkUserAllowedLinksImages();

/** @var HtmlDocument $doc */
$this->doc = $this->app->getDocument();
Expand Down
2 changes: 1 addition & 1 deletion src/site/template/aurelia/layouts/topic/edit/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
</div>
<?php endif; ?>

<?php if ($this->allowedExtensions && $this->UserCanPostImage) : ?>
<?php if ($this->allowedExtensions && !$this->UserCanPostImage) : ?>
<h2>
<?php echo Text::_('COM_KUNENA_EDITOR_ATTACHMENTS'); ?>
</h2>
Expand Down

0 comments on commit 1fffba2

Please sign in to comment.