Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 30 deletions.
4 changes: 3 additions & 1 deletion src/Compress/Bz2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Compress/Gz.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions test/Compress/Bz2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 0 additions & 8 deletions test/Compress/GzTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
4 changes: 0 additions & 4 deletions test/CompressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 0 additions & 4 deletions test/DecompressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 0 additions & 4 deletions test/Encrypt/BlockCipherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 0 additions & 4 deletions test/Encrypt/OpensslTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit a37f906

Please sign in to comment.