Permalink
Browse files

Bug #16759 - add additional safeguard using function_exists()

git-svn-id: https://svn.php.net/repository/pear/packages/Archive_Tar/trunk@323260 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 52c56fc commit 1f78c5945746dfdb486460eb7bd1d9db47ac03a9 @mrook mrook committed Feb 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 Archive/Tar.php
View
@@ -674,9 +674,9 @@ function _isArchive($p_filename=null)
// {{{ _openWrite()
function _openWrite()
{
- if ($this->_compress_type == 'gz')
+ if ($this->_compress_type == 'gz' && function_exists('gzopen'))
$this->_file = @gzopen($this->_tarname, "wb9");
- else if ($this->_compress_type == 'bz2')
+ else if ($this->_compress_type == 'bz2' && function_exists('bzopen'))
$this->_file = @bzopen($this->_tarname, "w");
else if ($this->_compress_type == 'none')
$this->_file = @fopen($this->_tarname, "wb");

0 comments on commit 1f78c59

Please sign in to comment.