aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Cloud.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
committerMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
commit4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch)
treeaae7f2582b2b9c6596dcbf87c06a836434140830 /Zotlabs/Module/Cloud.php
parent22c89b6c660e185d5c5c6362acf23b145d932d15 (diff)
parent8fde0f01b8472082158b38386046ed606bcfbc49 (diff)
downloadvolse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip
Merge branch '3.0RC'3.0
Diffstat (limited to 'Zotlabs/Module/Cloud.php')
-rw-r--r--Zotlabs/Module/Cloud.php43
1 files changed, 34 insertions, 9 deletions
diff --git a/Zotlabs/Module/Cloud.php b/Zotlabs/Module/Cloud.php
index 75191a279..2215507ca 100644
--- a/Zotlabs/Module/Cloud.php
+++ b/Zotlabs/Module/Cloud.php
@@ -57,12 +57,12 @@ 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.
- $_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']);
+ $x = clean_query_string();
+ if($x !== \App::$query_string)
+ goaway(z_root() . '/' . $x);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
@@ -83,17 +83,42 @@ class Cloud extends \Zotlabs\Web\Controller {
$server->addPlugin($browser);
// Experimental QuotaPlugin
- // require_once('\Zotlabs\Storage/QuotaPlugin.php');
- // $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
+ // require_once('\Zotlabs\Storage/QuotaPlugin.php');
+ // $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
+
+
+ // over-ride the default XML output on thrown exceptions
+
+ $server->on('exception', [ $this, 'DAVException' ]);
-// ob_start();
// All we need to do now, is to fire up the server
+
$server->exec();
-// ob_end_flush();
if($browser->build_page)
construct_page();
+
+ killme();
+ }
+
+
+ function DAVException($err) {
+
+ if($err instanceof \Sabre\DAV\Exception\NotFound) {
+ notice( t('Not found') . EOL);
+ }
+ elseif($err instanceof \Sabre\DAV\Exception\Forbidden) {
+ notice( t('Permission denied') . EOL);
+ }
+ else {
+ notice( t('Unknown error') . EOL);
+ }
+
+ construct_page();
+
killme();
}
}
+
+