mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Better error handling on invalid .tgz packages
This commit is contained in:
parent
f98251f307
commit
38ad5ff8d7
1 changed files with 9 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue