aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Cloud.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-03 14:07:00 -0700
committerzotlabs <mike@macgirvin.com>2017-11-03 14:07:00 -0700
commit1159dd59edc40b753b9f4fe55165b4ee3c22285d (patch)
treec396300847e0c849acd4426bac5949099944474f /Zotlabs/Module/Cloud.php
parente70bd0054c4ffb8aadeec8ee7c14dccdb34ab934 (diff)
downloadvolse-hubzilla-1159dd59edc40b753b9f4fe55165b4ee3c22285d.tar.gz
volse-hubzilla-1159dd59edc40b753b9f4fe55165b4ee3c22285d.tar.bz2
volse-hubzilla-1159dd59edc40b753b9f4fe55165b4ee3c22285d.zip
fix cloud redirects with owt tokens
Diffstat (limited to 'Zotlabs/Module/Cloud.php')
-rw-r--r--Zotlabs/Module/Cloud.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/Zotlabs/Module/Cloud.php b/Zotlabs/Module/Cloud.php
index 75191a279..d2264092b 100644
--- a/Zotlabs/Module/Cloud.php
+++ b/Zotlabs/Module/Cloud.php
@@ -57,12 +57,21 @@ class Cloud extends \Zotlabs\Web\Controller {
$auth->observer = $ob_hash;
}
+ // if we arrived at this path with any query parameters in the url, build a clean url without
+ // them and redirect.
+ // @fixme if the filename has an ampersand in it AND there are query parameters,
+ // this may not do the right thing.
+
+ if((strpos($_SERVER['QUERY_STRING'],'?') !== false) || (strpos($_SERVER['QUERY_STRING'],'&') !== false && strpos($_SERVER['QUERY_STRING'],'&amp;') === false)) {
+ $path = z_root();
+ if(argc()) {
+ foreach(\App::$argv as $a) {
+ $path .= '/' . $a;
+ }
+ }
+ goaway($path);
+ }
- $_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
- $_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
-
- $_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
- $_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);