summaryrefslogtreecommitdiff
path: root/groups.php
diff options
context:
space:
mode:
Diffstat (limited to 'groups.php')
-rw-r--r--groups.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/groups.php b/groups.php
index b372712..cbcb4a9 100644
--- a/groups.php
+++ b/groups.php
@@ -5,21 +5,19 @@ require_once "init.php";
require_once BASE . "/lib/style.php";
require_once BASE . "/lib/mysql.php";
-$uri_parts = explode('/', $_SERVER['REQUEST_URI']);
+$options = explode('?', $_SERVER['REQUEST_URI'], 2);
+
+$uri_parts = explode('/', $options[0]);
+if (count($options) == 2)
+ $options = $options[1];
+else
+ $options = '';
+if ($uri_parts[count($uri_parts)-1] == '')
+ array_pop($uri_parts);
if ($uri_parts[0] != '' || $uri_parts[1] != 'groups')
throw_http_error(422, 'Unprocessable Entity');
-$options = '';
-
-$last = array_pop($uri_parts);
-if (substr($last, 0, 1) == '?') {
- $options = $last;
- $last = array_pop($uri_parts);
-}
-if ($last != '')
- array_push($uri_parts, $last);
-
array_splice(
$uri_parts,
0, 2