diff options
| author | Mario <mario@mariovavti.com> | 2018-01-09 09:00:20 +0100 | 
|---|---|---|
| committer | Mario <mario@mariovavti.com> | 2018-01-09 09:00:20 +0100 | 
| commit | 4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch) | |
| tree | aae7f2582b2b9c6596dcbf87c06a836434140830 /Zotlabs/Module/Cloud.php | |
| parent | 22c89b6c660e185d5c5c6362acf23b145d932d15 (diff) | |
| parent | 8fde0f01b8472082158b38386046ed606bcfbc49 (diff) | |
| download | volse-hubzilla-3.0.tar.gz volse-hubzilla-3.0.tar.bz2 volse-hubzilla-3.0.zip  | |
Merge branch '3.0RC'3.0
Diffstat (limited to 'Zotlabs/Module/Cloud.php')
| -rw-r--r-- | Zotlabs/Module/Cloud.php | 43 | 
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();  	}  } + +  | 
