Author: rb Date: Tue Nov 27 16:18:19 2007 New Revision: 6835 Log: - Fixed issue #012044: strange long link file. The problem was that the wrong TAR type was recognized. (Ustar instead of GNU tar).
Modified: trunk/Archive/src/archive_mime.php trunk/Archive/tests/archive_test.php Modified: trunk/Archive/src/archive_mime.php ============================================================================== --- trunk/Archive/src/archive_mime.php [iso-8859-1] (original) +++ trunk/Archive/src/archive_mime.php [iso-8859-1] Tue Nov 27 16:18:19 2007 @@ -245,14 +245,15 @@ */ public static function tarContainsFileName( $data ) { - $rest = trim( substr( $data, 0, 100 ), "a..zA..Z0..9/_.\0" ); - - if ( strlen( $rest ) == 0 ) - { - return true; - } - - return false; + return $data[0] != "\0"; + + // $rest = trim( substr( $data, 0, 100 ), "a..zA..Z0..9/_.-\0" ); + // if ( strlen( $rest ) == 0 ) + // { + // return true; + // } + // + // return false; } } ?> Modified: trunk/Archive/tests/archive_test.php ============================================================================== --- trunk/Archive/tests/archive_test.php [iso-8859-1] (original) +++ trunk/Archive/tests/archive_test.php [iso-8859-1] Tue Nov 27 16:18:19 2007 @@ -35,6 +35,21 @@ $this->assertFalse( $archive->algorithmCanWrite() ); } + + public function testRecognizeGnuTar2() + { + $file = dirname(__FILE__). '/data/gnu_tar.tar'; + $archive = ezcArchive::open( $file ); + $this->assertEquals( ezcArchive::TAR_GNU, $archive->getAlgorithm() ); + } + + public function testRecognizeGnuTar3() + { + $file = dirname(__FILE__). '/data/gnu_tar2.tar'; + $archive = ezcArchive::open( $file ); + $this->assertEquals( ezcArchive::TAR_GNU, $archive->getAlgorithm() ); + } + public function testRecognizeUstar() { @@ -404,7 +419,6 @@ - public static function suite() { return new PHPUnit_Framework_TestSuite( "ezcArchiveTest"); -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components