summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-01-10 12:49:10 +0400
committerAndrew Dolgov <[email protected]>2012-01-10 12:49:10 +0400
commita3e0bdcffc757bd196de7e43bd9aa9cf8ca32626 (patch)
tree57c680e388d980a8143b61e643673bcfd08298e7
parent66b042fcfeac7273b0e3ed249a93f7cb3603c891 (diff)
fix tmhOAuth missing query parameters (closes #416)
-rw-r--r--include/functions.php1
-rw-r--r--include/rssfuncs.php22
2 files changed, 21 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php
index 650196830..5ccbe8a58 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -5336,5 +5336,4 @@
}
}
-
?>
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 84173f05a..5502c9f50 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -172,7 +172,8 @@
'user_secret' => $access_token['oauth_token_secret'],
));
- $code = $tmhOAuth->request('GET', $url);
+ $code = $tmhOAuth->request('GET', $url,
+ convertUrlQuery(parse_url($url, PHP_URL_QUERY)));
if ($code == 200) {
@@ -1375,4 +1376,23 @@
}
}
+ /**
+ * Source: http://www.php.net/manual/en/function.parse-url.php#104527
+ * Returns the url query as associative array
+ *
+ * @param string query
+ * @return array params
+ */
+ function convertUrlQuery($query) {
+ $queryParts = explode('&', $query);
+
+ $params = array();
+
+ foreach ($queryParts as $param) {
+ $item = explode('=', $param);
+ $params[$item[0]] = $item[1];
+ }
+
+ return $params;
+ }
?>