[event_spamblock] Don't overwrite "moderate" flag.

Unconditionally setting $serendipity['csuccess']
to 'true' will override a "moderate" flag set by
another (spamblock) plugin.

Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2019-08-17 04:07:30 +02:00
parent 4e662bf17c
commit 1bc7c4bd0f
4 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,7 @@
1.41.3:
-------
* Add missing English language constant.
1.38: 1.38:
----- -----
* Fixed preview of extended properties by 1.37 * Fixed preview of extended properties by 1.37

View File

@ -19,7 +19,7 @@ class serendipity_event_entryproperties extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC); $propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC);
$propbag->add('stackable', false); $propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking'); $propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '1.41.2'); $propbag->add('version', '1.41.3');
$propbag->add('requirements', array( $propbag->add('requirements', array(
'serendipity' => '1.6', 'serendipity' => '1.6',
'smarty' => '2.6.27', 'smarty' => '2.6.27',

View File

@ -0,0 +1,2 @@
1.88.2: Don't overwrite "moderate" flags from other plugins.
($serendipity['csuccess'])

View File

@ -25,7 +25,7 @@ class serendipity_event_spamblock extends serendipity_event
'smarty' => '2.6.7', 'smarty' => '2.6.7',
'php' => '4.1.0' 'php' => '4.1.0'
)); ));
$propbag->add('version', '1.88.1'); $propbag->add('version', '1.88.2');
$propbag->add('event_hooks', array( $propbag->add('event_hooks', array(
'frontend_saveComment' => true, 'frontend_saveComment' => true,
'external_plugin' => true, 'external_plugin' => true,
@ -876,7 +876,9 @@ class serendipity_event_spamblock extends serendipity_event
if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) { if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) {
$this->checkScheme(); $this->checkScheme();
$serendipity['csuccess'] = 'true'; if (!isset($serendipity['csuccess'])) {
$serendipity['csuccess'] = 'true';
}
$logfile = $this->logfile = $this->get_config('logfile', $serendipity['serendipityPath'] . 'spamblock.log'); $logfile = $this->logfile = $this->get_config('logfile', $serendipity['serendipityPath'] . 'spamblock.log');
$required_fields = $this->get_config('required_fields', ''); $required_fields = $this->get_config('required_fields', '');
$checkmail = $this->get_config('checkmail'); $checkmail = $this->get_config('checkmail');