From: Greg Beaver Date: Sat, 19 Apr 2008 05:53:57 +0000 (+0000) Subject: new test for zip archives with files created from stdin X-Git-Tag: RELEASE_2_0_0b1~323 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d1e0b431120e5c17e64b3f22dfb18bb934ba7e2;p=php new test for zip archives with files created from stdin --- diff --git a/ext/phar/tests/zip/corrupt_006.phpt b/ext/phar/tests/zip/corrupt_006.phpt new file mode 100644 index 0000000000..9c83617a9a --- /dev/null +++ b/ext/phar/tests/zip/corrupt_006.phpt @@ -0,0 +1,17 @@ +--TEST-- +Phar: zip with file created from stdin +--SKIPIF-- + + +--FILE-- +getMessage() . "\n"; +} +?> +===DONE=== +--EXPECTF-- +phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip" +===DONE=== diff --git a/ext/phar/tests/zip/files/corrupt2.php.inc b/ext/phar/tests/zip/files/corrupt2.php.inc index b396d58290..646eb1bb93 100644 --- a/ext/phar/tests/zip/files/corrupt2.php.inc +++ b/ext/phar/tests/zip/files/corrupt2.php.inc @@ -4,4 +4,8 @@ $a = new corrupt_zipmaker; $a->addFile('hi', null, 'hii'); $a->addFile('hi2', null, 'hii2', null, null, 'encrypt', 'encrypt'); $a->writeZip(dirname(__FILE__) . '/encrypted.zip'); +$a = new corrupt_zipmaker; +$a->addFile('hi', null, 'hii'); +$a->addFile('', null, 'stdin'); +$a->writeZip(dirname(__FILE__) . '/stdin.zip'); ?> diff --git a/ext/phar/tests/zip/files/encrypted.zip b/ext/phar/tests/zip/files/encrypted.zip index 00aed14f04..bb3727df25 100644 Binary files a/ext/phar/tests/zip/files/encrypted.zip and b/ext/phar/tests/zip/files/encrypted.zip differ diff --git a/ext/phar/tests/zip/files/stdin.zip b/ext/phar/tests/zip/files/stdin.zip new file mode 100644 index 0000000000..fdbe930983 Binary files /dev/null and b/ext/phar/tests/zip/files/stdin.zip differ