@@ -111,13 +111,13 @@ public function setBaseUri($uri) {
111111 */
112112 protected function httpOptions () {
113113
114- $ this ->addHeader ('Allow ' ,strtoupper (implode (' ' ,$ this ->getAllowedMethods ())));
114+ $ this ->httpResponse -> setHeader ('Allow ' ,strtoupper (implode (' ' ,$ this ->getAllowedMethods ())));
115115 if ($ this ->tree ->supportsLocks ()) {
116- $ this ->addHeader ('DAV ' ,'1,2,3 ' );
116+ $ this ->httpResponse -> setHeader ('DAV ' ,'1,2,3 ' );
117117 } else {
118- $ this ->addHeader ('DAV ' ,'1,3 ' );
118+ $ this ->httpResponse -> setHeader ('DAV ' ,'1,3 ' );
119119 }
120- $ this ->addHeader ('MS-Author-Via ' ,'DAV ' );
120+ $ this ->httpResponse -> setHeader ('MS-Author-Via ' ,'DAV ' );
121121
122122 }
123123
@@ -132,9 +132,9 @@ protected function httpGet() {
132132
133133 $ nodeInfo = $ this ->tree ->getNodeInfo ($ this ->getRequestUri (),0 );
134134
135- if ($ nodeInfo [0 ]['size ' ]) $ this ->addHeader ('Content-Length ' ,$ nodeInfo [0 ]['size ' ]);
135+ if ($ nodeInfo [0 ]['size ' ]) $ this ->httpResponse -> setHeader ('Content-Length ' ,$ nodeInfo [0 ]['size ' ]);
136136
137- $ this ->addHeader ('Content-Type ' , 'application/octet-stream ' );
137+ $ this ->httpResponse -> setHeader ('Content-Type ' , 'application/octet-stream ' );
138138 echo $ this ->tree ->get ($ this ->getRequestUri ());
139139
140140 }
@@ -151,8 +151,8 @@ protected function httpGet() {
151151 protected function httpHead () {
152152
153153 $ nodeInfo = $ this ->tree ->getNodeInfo ($ this ->getRequestUri (),0 );
154- if ($ nodeInfo [0 ]['size ' ]) $ this ->addHeader ('Content-Length ' ,$ nodeInfo [0 ]['size ' ]);
155- $ this ->addHeader ('Content-Type ' , 'application/octet-stream ' );
154+ if ($ nodeInfo [0 ]['size ' ]) $ this ->httpResponse -> setHeader ('Content-Length ' ,$ nodeInfo [0 ]['size ' ]);
155+ $ this ->httpResponse -> setHeader ('Content-Type ' , 'application/octet-stream ' );
156156
157157 }
158158
@@ -219,7 +219,7 @@ protected function httpPropfind() {
219219
220220 // This is a multi-status response
221221 $ this ->httpResponse ->sendStatus (207 );
222- $ this ->addHeader ('Content-Type ' ,'text/xml; charset="utf-8" ' );
222+ $ this ->httpResponse -> setHeader ('Content-Type ' ,'text/xml; charset="utf-8" ' );
223223 $ data = $ this ->generatePropfindResponse ($ fileList ,$ properties );
224224 echo $ data ;
225225
@@ -323,7 +323,7 @@ protected function httpPOST() {
323323 }
324324
325325 // We assume > 5.1.2, which has the header injection attack prevention
326- if (isset ($ _POST ['redirectUrl ' ]) && is_string ($ _POST ['redirectUrl ' ])) header ('Location: ' . $ _POST ['redirectUrl ' ]);
326+ if (isset ($ _POST ['redirectUrl ' ]) && is_string ($ _POST ['redirectUrl ' ])) $ this -> httpResponse -> setHeader ('Location ' , $ _POST ['redirectUrl ' ]);
327327
328328 }
329329
@@ -478,7 +478,7 @@ protected function httpLock() {
478478 }
479479
480480 $ this ->tree ->lockNode ($ uri ,$ lockInfo );
481- $ this ->addHeader ('Lock-Token ' ,'opaquelocktoken: ' . $ lockInfo ->token );
481+ $ this ->httpResponse -> setHeader ('Lock-Token ' ,'opaquelocktoken: ' . $ lockInfo ->token );
482482 echo $ this ->generateLockResponse ($ lockInfo );
483483
484484 }
@@ -561,19 +561,6 @@ protected function getAllowedMethods() {
561561
562562 }
563563
564- /**
565- * Adds an HTTP response header
566- *
567- * @param string $name
568- * @param string $value
569- * @return void
570- */
571- protected function addHeader ($ name ,$ value ) {
572-
573- header ($ name . ': ' . str_replace (array ("\n" ,"\r" ),array ('\n ' ,'\r ' ),$ value ));
574-
575- }
576-
577564 /**
578565 * Gets the uri for the request, keeping the base uri into consideration
579566 *
0 commit comments