File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 111.2.0beta2 (2010-05-??)
2+ * Fixed: Issue 46: Fatal error for some non-existant nodes.
23 * Updated: some example sql to include email address.
34 * Added: 208 and 508 statuscodes from RFC5842.
45 * Added: Apache2 configuration examples
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ public function getNodeForPath($path) {
5454 // If this part of the path is just a dot, it actually means we can skip it
5555 if ($ pathPart =='. ' || $ pathPart =='' ) continue ;
5656
57+ if (!($ currentNode instanceof Sabre_DAV_ICollection))
58+ throw new Sabre_DAV_Exception_FileNotFound ('Could not find node at path: ' . $ path );
59+
5760 $ currentNode = $ currentNode ->getChild ($ pathPart );
5861
5962 }
Original file line number Diff line number Diff line change @@ -44,6 +44,20 @@ function testGetDoesntExist() {
4444
4545 }
4646
47+ function testGetDoesntExist2 () {
48+
49+ $ serverVars = array (
50+ 'REQUEST_URI ' => '/test.txt/randomblbla ' ,
51+ 'REQUEST_METHOD ' => 'GET ' ,
52+ );
53+
54+ $ request = new Sabre_HTTP_Request ($ serverVars );
55+ $ this ->server ->httpRequest = ($ request );
56+ $ this ->server ->exec ();
57+ $ this ->assertEquals ('HTTP/1.1 404 Not Found ' ,$ this ->response ->status );
58+
59+ }
60+
4761 /**
4862 * This test should have the exact same result as testGet.
4963 *
You can’t perform that action at this time.
0 commit comments