com web/bugs: We don't use akismet: include/akismet.php
| From: | sobak@php.net | Date: | Sun, 18 May 2014 05:08:36 +0000 |
| Subject: | com web/bugs: We don't use akismet: include/akismet.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18929@lists.php.net to get a copy of this message | ||
Commit: 564a8f5cb2c915ccd2bceb392b74ccd714e2166e
Author: Sobak <msobaczewski@gmail.com> Sun, 18 May 2014 07:08:36 +0200
Parents: a4630841643fe47352a20de31271b43089bb56d8
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=564a8f5cb2c915ccd2bceb392b74ccd714e2166e
Log:
We don't use akismet
Changed paths:
D include/akismet.php
Diff:
diff --git a/include/akismet.php b/include/akismet.php
deleted file mode 100644
index f98fade..0000000
--- a/include/akismet.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-// This requires
-//
-// pear install channel://pear.php.net/Net_URL2-0.3.1
-// pear install channel://pear.php.net/HTTP_Request2-0.5.1
-// pear install channel://pear.php.net/Services_Akismet2-0.3.0
-
-include 'Services/Akismet2.php';
-
-function akismet($content, $author=null, $authorEmail=null, $authorUri=null) {
- static $apiKey = getenv('AKISMET_KEY');
-
- $comment = new Services_Akismet2_Comment(array(
- 'author' => $author,
- 'authorEmail' => $authorEmail,
- 'authorUri' => $authorUri,
- 'content' => $content
- ));
-
- $isSpam = false;
- try {
- $akismet = new Services_Akismet2('http://bugs.php.net/', $apiKey);
- if ($akismet->isSpam($comment)) {
- $isSpam = true;
- }
- } catch (Services_Akismet2_InvalidApiKeyException $keyException) {
- // echo 'Invalid API key!';
- } catch (Services_Akismet2_HttpException $httpException) {
- // echo 'Error communicating with Akismet API server: ' .
$httpException->getMessage();
- } catch (Services_Akismet2_InvalidCommentException $commentException) {
- // echo 'Specified comment is missing one or more required fields.' .
$commentException->getMessage();
- }
-
- return $isSpam;
-}