[Pkg-owncloud-commits] [php-sabredav] 03/10: Fixes Issue 31.

David Prévot taffit at moszumanska.debian.org
Sat Nov 30 15:44:15 UTC 2013


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

taffit pushed a commit to tag version-1.0.15
in repository php-sabredav.

commit 2c941a12f6b2c9b3bfeb2a69e60f997ded2b0e6e
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Tue Apr 20 00:28:53 2010 +0900

    Fixes Issue 31.
---
 ChangeLog                |  2 ++
 lib/Sabre/DAV/Server.php | 18 +++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 30c3dd1..17f8461 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
 1.0.15-stable (2010-05-??)
+	* Added: Issue 31: Hiding exception information by default. Can be turned
+	  on with the Sabre_DAV_Server::$debugExceptions property.
 
 1.0.14-stable (2010-04-15)
 	* Fixed: double namespace declaration in multistatus responses.
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php
index 8450002..ad86b80 100644
--- a/lib/Sabre/DAV/Server.php
+++ b/lib/Sabre/DAV/Server.php
@@ -87,6 +87,15 @@ class Sabre_DAV_Server {
     );
 
     /**
+     * This is a flag that allow or not showing file, line and code
+     * of the exception in the returned XML
+     *
+     * @var bool 
+     */
+    public $debugExceptions = false;
+
+
+    /**
      * Class constructor 
      * 
      * @param Sabre_DAV_Tree $tree The tree object 
@@ -122,9 +131,12 @@ class Sabre_DAV_Server {
 
             $error->appendChild($DOM->createElement('s:exception',get_class($e)));
             $error->appendChild($DOM->createElement('s:message',$e->getMessage()));
-            $error->appendChild($DOM->createElement('s:file',$e->getFile()));
-            $error->appendChild($DOM->createElement('s:line',$e->getLine()));
-            $error->appendChild($DOM->createElement('s:code',$e->getCode()));
+            if ($this->debugExceptions) {
+                $error->appendChild($DOM->createElement('s:file',$e->getFile()));
+                $error->appendChild($DOM->createElement('s:line',$e->getLine()));
+                $error->appendChild($DOM->createElement('s:code',$e->getCode()));
+                $error->appendChild($DOM->createElement('s:stacktrace',$e->getTraceAsString()));
+            }
             $error->appendChild($DOM->createElement('s:sabredav-version',Sabre_DAV_Version::VERSION));
 
             if($e instanceof Sabre_DAV_Exception) {

-- 
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