aboutsummaryrefslogtreecommitdiff
path: root/lib/urlhelper.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-08-18 23:54:32 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-08-18 23:54:32 +0200
commitdb2f09d46ce2f3a46be1b6f6e031492966242025 (patch)
tree4e22eba650c022936a4071afd9b2b0ee417ad34b /lib/urlhelper.php
parent3780cf15a59c48b3d71e8ec27e3bdacd8a119460 (diff)
downloadgrauphel-db2f09d46ce2f3a46be1b6f6e031492966242025.tar.gz
grauphel-db2f09d46ce2f3a46be1b6f6e031492966242025.zip
oauth dance works
Diffstat (limited to 'lib/urlhelper.php')
-rw-r--r--lib/urlhelper.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/urlhelper.php b/lib/urlhelper.php
new file mode 100644
index 0000000..e0de8f9
--- /dev/null
+++ b/lib/urlhelper.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Part of grauphel
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package Grauphel
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/grauphel.htm
+ */
+namespace OCA\Grauphel\Lib;
+
+/**
+ * URL helper methods
+ *
+ * @category Tools
+ * @package Grauphel
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @version Release: @package_version@
+ * @link http://cweiske.de/grauphel.htm
+ */
+class UrlHelper
+{
+ public static function addParams($url, $arParams)
+ {
+ $parts = array();
+ foreach($arParams as $key => $val) {
+ if ($val != '') {
+ $parts[] = urlencode($key) . '=' . urlencode($val);
+ }
+ }
+ $sep = (strpos($url, '?') !== false) ? '&' : '?';
+ return $url . $sep . implode('&', $parts);
+ }
+}
+?>