]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Irc/extlib/phergie/Phergie/Plugin/Http.php
Merged in Phergie changes
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Plugin / Http.php
index 43c69eb8797f9bd94af86ecdb4fc3cd223b18792..7c5c8704c2b23e08dbe8805f367faea216ea5b45 100644 (file)
@@ -184,7 +184,10 @@ class Phergie_Plugin_Http extends Phergie_Plugin_Abstract
             $type = $this->response->getHeaders('content-type');
             foreach ($this->handlers as $expr => $handler) {
                 if (preg_match('#^' . $expr . '$#i', $type)) {
-                    $body = call_user_func($handler, $body);
+                    $handled = call_user_func($handler, $body);
+                    if (!empty($handled)) {
+                        $body = $handled;
+                    }
                 }
             }
 
@@ -256,7 +259,7 @@ class Phergie_Plugin_Http extends Phergie_Plugin_Abstract
     public function post($url, array $query = array(),
         array $post = array(), array $context = array()
     ) {
-        if (!empty($params)) {
+        if (!empty($query)) {
             $url .= '?' . http_build_query($query);
         }
 
@@ -278,4 +281,4 @@ class Phergie_Plugin_Http extends Phergie_Plugin_Abstract
 
         return $this->request($url, $context);
     }
-}
+}
\ No newline at end of file