summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2003-08-05 13:51:33 +0000
committerTomas V.V.Cox <cox@php.net>2003-08-05 13:51:33 +0000
commit38ad5ff8d77e07100da5e3ca68fc5c9cb6855972 (patch)
tree60ba278a0299f2c75cafee9f6a6c7ec96ac5ba0a
parentf98251f307a542b03beacf3b0454ab3daf3197e2 (diff)
downloadphp-git-38ad5ff8d77e07100da5e3ca68fc5c9cb6855972.tar.gz
Better error handling on invalid .tgz packages
-rw-r--r--pear/PEAR/Common.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php
index d1fccdb64d..03bb5c54a0 100644
--- a/pear/PEAR/Common.php
+++ b/pear/PEAR/Common.php
@@ -676,9 +676,17 @@ class PEAR_Common extends PEAR
return $this->raiseError("could not open file \"$file\"");
}
$tar = new Archive_Tar($file);
+ if ($this->debug <= 1) {
+ $tar->pushErrorHandling(PEAR_ERROR_RETURN);
+ }
$content = $tar->listContent();
+ if ($this->debug <= 1) {
+ $tar->popErrorHandling();
+ }
if (!is_array($content)) {
- return $this->raiseError("could not get contents of package \"$file\"");
+ $file = realpath($file);
+ return $this->raiseError("Could not get contents of package \"$file\"".
+ '. Invalid tgz file.');
}
$xml = null;
foreach ($content as $file) {