PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_WebDAV_Client » Bug #994

Rogue print_r() function

Details

Submitted2004-03-11 11:25 UTC
Froms dot binge at codefusion dot co dot za
Assignedhholzgra
StatusClosed
PackageHTTP_WebDAV_Client
PHP Version4.3.4
OSAny
Roadmaps(Not assigned)

Comments

[2004-03-11 11:25 UTC] s dot binge at codefusion dot co dot za

Description:
------------
There is a rogue print_r() function in the _parse_propfind_response.php file which is executed when opening a file through WebDAV (i.e. fopen('webdav://blah');), when the file already exists on the server. The results of this print_r() are dumped right in the middle of any other output one may be displaying when you call fopen();

An artifact from a debug session, perhaps?

Reproduce code:
---------------
require_once 'HTTP/WebDAV/Client.php';

echo "Hello ";
fopen("webdav://my.webdav.server/file.dat", 'w');
echo "World";

Expected result:
----------------
An "Array ( ... )" dump will be printed out in between the words "Hello" and "World", assuming 'file.dat' exists on the WebDAV server 'my.webdav.server'.

Actual result:
--------------
Hello Array
(
[/file.dat] => Array
(
[mode] => 438
[size] => 4
[atime] => 1079002803
[mtime] => 1079002803
[ctime] => 1078995603
)

)
World

[2004-03-11 11:29 UTC] s dot binge at codefusion dot co dot za

--- _parse_propfind_response.php.old 2003-12-15 12:59:22.000000000 +0200
+++ _parse_propfind_response.php 2004-01-28 15:06:49.000000000 +0200
@@ -125,7 +125,6 @@
// TODO
} else {
reset($this->urls);
- print_r($this->urls);
return current($this->urls);
}
}

[2004-03-11 11:33 UTC] s dot binge at codefusion dot co dot za

Sorry, I misunderstood the meaning of the 'Expected Result' field. In this case it should be:

No output should occur when fopen()'ing a WebDAV stream, regardless of whether the required file exists on the server or not.