fix cloud redirects with owt tokens

This commit is contained in:
zotlabs
2017-11-03 14:07:00 -07:00
parent e70bd0054c
commit 1159dd59ed
2 changed files with 38 additions and 4 deletions

View File

@@ -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.
$_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
$_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
if((strpos($_SERVER['QUERY_STRING'],'?') !== false) || (strpos($_SERVER['QUERY_STRING'],'&') !== false && strpos($_SERVER['QUERY_STRING'],'&') === false)) {
$path = z_root();
if(argc()) {
foreach(\App::$argv as $a) {
$path .= '/' . $a;
}
}
goaway($path);
}
$_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);