Skip to content

Commit

Permalink
make sure updates only disable the post
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Aug 24, 2019
1 parent 1fe772b commit ba5f938
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/system/event/listener/AntiSpamListener.class.php
Expand Up @@ -81,8 +81,10 @@ public function execute($eventObj, $className, $eventName, array &$parameters)

if ($this->checkContent($content) || $this->checkContent($title))
{
// When this is the first post we should only disable it
if (isset($parameters['isFirstPost']) && $parameters['isFirstPost'] === true)
// When this is the first post or we edit an post we should only disable it
if (isset($parameters['isFirstPost'])
&& $parameters['isFirstPost'] === true
|| $actionName === 'update')
{
$eventObj->disable();

Expand All @@ -98,6 +100,7 @@ public function execute($eventObj, $className, $eventName, array &$parameters)

case 'trash':
$eventObj->trash();

break;

case 'disable':
Expand Down

0 comments on commit ba5f938

Please sign in to comment.