From 86c4f46609d6fad866301f094cc5af48111c5fad Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Wed, 25 Mar 2009 10:41:38 +0000 Subject: [PATCH] * Changed karma plugin to only track GET requests as visits, not POSTs. Thanks to Marcus Friedman --- docs/NEWS | 3 +++ plugins/serendipity_event_karma/serendipity_event_karma.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 2ad76c22..23012d4d 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.5 () ------------------------------------------------------------------------ + * Changed karma plugin to only track GET requests as visits, not + POSTs. Thanks to Marcus Friedman + * Enhanced nl2br plugin to also use

tags, by onli * Added possibility for templates to register a central function diff --git a/plugins/serendipity_event_karma/serendipity_event_karma.php b/plugins/serendipity_event_karma/serendipity_event_karma.php index 801b19a3..aeb00609 100644 --- a/plugins/serendipity_event_karma/serendipity_event_karma.php +++ b/plugins/serendipity_event_karma/serendipity_event_karma.php @@ -54,7 +54,7 @@ class serendipity_event_karma extends serendipity_event $propbag->add('description', PLUGIN_KARMA_BLAHBLAH); $propbag->add('stackable', false); $propbag->add('author', 'Garvin Hicking, Grischa Brockhaus, Gregor Völtz, Judebert'); - $propbag->add('version', '2.2'); + $propbag->add('version', '2.3'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -975,7 +975,7 @@ END_IMG_CSS; // Update the number of visits // Are we supposed to track visits? $track_clicks = serendipity_db_bool($this->get_config('visits_active', true)) && $this->track_clicks_allowed_by_user(); - if ($track_clicks) { + if ($track_clicks && $_SERVER['REQUEST_METHOD'] == 'GET') { $sql = serendipity_db_query( "UPDATE {$serendipity['dbPrefix']}karma SET visits = visits + 1