]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/httpclient.php
HTTPClient get $params array and oEmbedHelper uses it
[quix0rs-gnu-social.git] / lib / httpclient.php
index 865fc9029e847134b0668fc3ba9eee7b8eab33aa..bc513e71d03359b893a95b75cb044b98ab332a7e 100644 (file)
@@ -177,8 +177,17 @@ class HTTPClient extends HTTP_Request2
     /**
      * Quick static function to GET a URL
      */
-    public static function quickGet($url, $accept=null)
+    public static function quickGet($url, $accept=null, $params=array())
     {
+        if (!empty($params)) {
+            $params = http_build_query($params, null, '&');
+            if (strpos($url, '?') === false) {
+                $url .= '?' . $params;
+            } else {
+                $url .= '&' . $params;
+            }
+        }
+
         $client = new HTTPClient();
         if (!is_null($accept)) {
             $client->setHeader('Accept', $accept);