X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FBlogspamNetPlugin.php;h=d52e6006ac8dbb4bc33bd203af9d59521782826f;hb=cbf321eeb371fecdb069a33301629a6d045425f1;hp=bf60fdcaf02fd8061968f3f2a05303050840c1fe;hpb=b10f362ede8c39746c168363bf4fa6481995592b;p=quix0rs-gnu-social.git diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php index bf60fdcaf0..d52e6006ac 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)) { @@ -85,7 +87,7 @@ class BlogspamNetPlugin extends Plugin } else if (preg_match('/^SPAM(:(.*))?$/', $response, $match)) { throw new ClientException(sprintf(_("Spam checker results: %s"), $match[2]), 400); } else if (preg_match('/^OK$/', $response)) { - // do not do anything + // don't do anything } else { throw new ServerException(sprintf(_("Unexpected response from %s: %s"), $this->baseUrl, $response), 500); } @@ -118,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; }