[Pkg-owncloud-commits] [php-sabredav] 26/66: Browser tweaks.

David Prévot taffit at moszumanska.debian.org
Sat Jan 18 20:08:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 156845d40c8d60caf1a2bc2881a8482fef2f2025
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Dec 11 20:26:38 2013 -0500

    Browser tweaks.
---
 ChangeLog                        |  2 ++
 lib/Sabre/DAV/Browser/Plugin.php | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b0a4419..610cb9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
 1.9.0-alpha2 (2013-??-??)
+	* Added: Browser can now inspect any node, if ?sabreaction=browser is
+	  appended.
 
 1.9.0-alpha1 (2013-11-07)
 	* The zip release ships with sabre/vobject 3.1.3, sabre/http 2.0.0alpha5,
diff --git a/lib/Sabre/DAV/Browser/Plugin.php b/lib/Sabre/DAV/Browser/Plugin.php
index 6ab8871..a3d888d 100644
--- a/lib/Sabre/DAV/Browser/Plugin.php
+++ b/lib/Sabre/DAV/Browser/Plugin.php
@@ -116,7 +116,10 @@ class Plugin extends DAV\ServerPlugin {
         // unit testable.
         $getVars = $request->getQueryParameters();
 
-        if (isset($getVars['sabreAction']) && $getVars['sabreAction'] === 'asset' && isset($getVars['assetName'])) {
+        $sabreAction = isset($getVars['sabreAction'])?$getVars['sabreAction']:null;
+
+        // Asset handling, such as images
+        if ($sabreAction === 'asset' && isset($getVars['assetName'])) {
             $this->serveAsset($getVars['assetName']);
             return false;
         }
@@ -128,7 +131,10 @@ class Plugin extends DAV\ServerPlugin {
             // with other plugins.
             return;
         }
-        if ($node instanceof DAV\IFile)
+
+        // Don't show the browser if it's a IFile node, unless
+        // sabreAction=browser.
+        if ($sabreAction!=='browser' && $node instanceof DAV\IFile)
             return;
 
         $response->setStatus(200);
@@ -385,7 +391,7 @@ class Plugin extends DAV\ServerPlugin {
         <address>Generated by SabreDAV " . $version . " (c)2007-2013 <a href=\"http://code.google.com/p/sabredav/\">http://code.google.com/p/sabredav/</a></address>
         </body>
         </html>";
-        
+
         $this->server->httpResponse->setHeader('Content-Security-Policy', "img-src 'self'; style-src 'unsafe-inline';");
 
         return $html;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list