summaryrefslogtreecommitdiff
path: root/plugins/BlogspamNetPlugin.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-11-02 06:56:31 -0800
committerBrion Vibber <brion@pobox.com>2009-11-02 07:51:29 -0800
commitb22fc5b74aecd505d4e2df01258171fc65d312cf (patch)
treeea8cf7eb0d0df0a449b760778bc796d476fb4507 /plugins/BlogspamNetPlugin.php
parentd8e2d76ba93557f8c12f966b5d0afccf9fbdc83b (diff)
Revert "Rebuilt HTTPClient class as an extension of PEAR HTTP_Request2 package, adding redirect handling and convenience functions."
Going to restructure a little more before finalizing this... This reverts commit fa37967858c3c29000797e510e5f98aca8ab558f.
Diffstat (limited to 'plugins/BlogspamNetPlugin.php')
-rw-r--r--plugins/BlogspamNetPlugin.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php
index 3bdc73556..c14569746 100644
--- a/plugins/BlogspamNetPlugin.php
+++ b/plugins/BlogspamNetPlugin.php
@@ -22,7 +22,6 @@
* @category Plugin
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
- * @author Brion Vibber <brion@status.net>
* @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
@@ -70,14 +69,14 @@ class BlogspamNetPlugin extends Plugin
{
$args = $this->testArgs($notice);
common_debug("Blogspamnet args = " . print_r($args, TRUE));
- $requestBody = xmlrpc_encode_request('testComment', array($args));
-
- $request = new HTTPClient($this->baseUrl, HTTP_Request2::METHOD_POST);
- $request->addHeader('Content-Type: text/xml');
- $request->setBody($requestBody);
- $httpResponse = $request->send();
-
- $response = xmlrpc_decode($httpResponse->getBody());
+ $request = xmlrpc_encode_request('testComment', array($args));
+ $context = stream_context_create(array('http' => array('method' => "POST",
+ 'header' =>
+ "Content-Type: text/xml\r\n".
+ "User-Agent: " . $this->userAgent(),
+ 'content' => $request)));
+ $file = file_get_contents($this->baseUrl, false, $context);
+ $response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
throw new ServerException("$response[faultString] ($response[faultCode])", 500);
} else {