From 1e8e1e836d53b357eb1ddd538c0ceb4d8b289f59 Mon Sep 17 00:00:00 2001 From: Christopher Vollick Date: Mon, 22 Feb 2010 11:19:16 -0500 Subject: Rewrote How Blogspam Plugin Made HTTP Requests. The old way didn't seem to work anymore. It was just sending empty requests. --- plugins/BlogspamNetPlugin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php index 51236001a..9b7ed1c12 100644 --- a/plugins/BlogspamNetPlugin.php +++ b/plugins/BlogspamNetPlugin.php @@ -72,8 +72,10 @@ class BlogspamNetPlugin extends Plugin common_debug("Blogspamnet args = " . print_r($args, TRUE)); $requestBody = xmlrpc_encode_request('testComment', array($args)); - $request = HTTPClient::start(); - $httpResponse = $request->post($this->baseUrl, array('Content-Type: text/xml'), $requestBody); + $request = new HTTPClient($this->baseUrl, HTTPClient::METHOD_POST); + $request->setHeader('Content-Type', 'text/xml'); + $request->setBody($requestBody); + $httpResponse = $request->send(); $response = xmlrpc_decode($httpResponse->getBody()); if (xmlrpc_is_fault($response)) { -- cgit v1.2.3-54-g00ecf From a6afc1cfd6e99d83322910d4c1dafb16b1c4ae90 Mon Sep 17 00:00:00 2001 From: Christopher Vollick Date: Mon, 22 Feb 2010 11:20:44 -0500 Subject: Made Blogspam Plugin Respect textlimit Setting. The Blogspam plugin was setting a max-size to 140. It was therefore rejecting posts with more characters as spam. This kind of defeated the purpose of setting a higher limit... --- plugins/BlogspamNetPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php index 9b7ed1c12..d52e6006a 100644 --- a/plugins/BlogspamNetPlugin.php +++ b/plugins/BlogspamNetPlugin.php @@ -120,7 +120,7 @@ class BlogspamNetPlugin extends Plugin $args['site'] = common_root_url(); $args['version'] = $this->userAgent(); - $args['options'] = "max-size=140,min-size=0,min-words=0,exclude=bayasian"; + $args['options'] = "max-size=" . common_config('site','textlimit') . ",min-size=0,min-words=0,exclude=bayasian"; return $args; } -- cgit v1.2.3-54-g00ecf