diff --git a/library/Zend/Filter/Compress/Bz2.php b/library/Zend/Filter/Compress/Bz2.php index 1e37109a20a..79716118b30 100644 --- a/library/Zend/Filter/Compress/Bz2.php +++ b/library/Zend/Filter/Compress/Bz2.php @@ -133,7 +133,9 @@ public function compress($content) public function decompress($content) { $archive = $this->getArchive(); - if (file_exists($content)) { + + //check if there are null byte characters before doing a file_exists check + if (!strstr($content, "\0") && file_exists($content)) { $archive = $content; } diff --git a/library/Zend/Filter/Compress/Gz.php b/library/Zend/Filter/Compress/Gz.php index cb1c47dc308..57d05dfdf1c 100644 --- a/library/Zend/Filter/Compress/Gz.php +++ b/library/Zend/Filter/Compress/Gz.php @@ -165,7 +165,9 @@ public function decompress($content) { $archive = $this->getArchive(); $mode = $this->getMode(); - if (file_exists($content)) { + + //check if there are null byte characters before doing a file_exists check + if (!strstr($content, "\0") && file_exists($content)) { $archive = $content; } diff --git a/tests/ZendTest/Filter/Compress/Bz2Test.php b/tests/ZendTest/Filter/Compress/Bz2Test.php index 0b62f2328be..645a9099001 100644 --- a/tests/ZendTest/Filter/Compress/Bz2Test.php +++ b/tests/ZendTest/Filter/Compress/Bz2Test.php @@ -37,10 +37,6 @@ public function tearDown() */ public function testBasicUsage() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - $filter = new Bz2Compression(); $content = $filter->compress('compress me'); diff --git a/tests/ZendTest/Filter/Compress/GzTest.php b/tests/ZendTest/Filter/Compress/GzTest.php index 51d9602d262..1f901bca871 100644 --- a/tests/ZendTest/Filter/Compress/GzTest.php +++ b/tests/ZendTest/Filter/Compress/GzTest.php @@ -37,10 +37,6 @@ public function tearDown() */ public function testBasicUsage() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - $filter = new GzCompression(); $content = $filter->compress('compress me'); @@ -164,10 +160,6 @@ public function testGzCompressToFile() */ public function testGzDeflate() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - $filter = new GzCompression(array('mode' => 'deflate')); $content = $filter->compress('compress me'); diff --git a/tests/ZendTest/Filter/CompressTest.php b/tests/ZendTest/Filter/CompressTest.php index fbcd47c1563..2aed886d094 100644 --- a/tests/ZendTest/Filter/CompressTest.php +++ b/tests/ZendTest/Filter/CompressTest.php @@ -37,10 +37,6 @@ public function tearDown() */ public function testBasicUsage() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - $filter = new CompressFilter('bz2'); $text = 'compress me'; diff --git a/tests/ZendTest/Filter/DecompressTest.php b/tests/ZendTest/Filter/DecompressTest.php index cc46b531ff5..b6e94752bda 100644 --- a/tests/ZendTest/Filter/DecompressTest.php +++ b/tests/ZendTest/Filter/DecompressTest.php @@ -37,10 +37,6 @@ public function tearDown() */ public function testBasicUsage() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - $filter = new DecompressFilter('bz2'); $text = 'compress me'; diff --git a/tests/ZendTest/Filter/Encrypt/BlockCipherTest.php b/tests/ZendTest/Filter/Encrypt/BlockCipherTest.php index 2273cfbe726..53759f2cebd 100644 --- a/tests/ZendTest/Filter/Encrypt/BlockCipherTest.php +++ b/tests/ZendTest/Filter/Encrypt/BlockCipherTest.php @@ -200,10 +200,6 @@ public function testSettingEmptyVector() */ public function testEncryptionWithDecryptionAndCompressionMcrypt() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - if (!extension_loaded('bz2')) { $this->markTestSkipped('This adapter needs the bz2 extension'); } diff --git a/tests/ZendTest/Filter/Encrypt/OpensslTest.php b/tests/ZendTest/Filter/Encrypt/OpensslTest.php index 972946ed2c4..e7f214c3564 100644 --- a/tests/ZendTest/Filter/Encrypt/OpensslTest.php +++ b/tests/ZendTest/Filter/Encrypt/OpensslTest.php @@ -274,10 +274,6 @@ public function testEncryptionWithDecryptionWithPackagedKeys() */ public function testEncryptionWithDecryptionAndCompressionWithPackagedKeys() { - if (version_compare(phpversion(), '5.4', '>=')) { - $this->markTestIncomplete('Code to test is not compatible with PHP 5.4 '); - } - if (!extension_loaded('bz2')) { $this->markTestSkipped('Bz2 extension for compression test needed'); }