From 0d1e0b431120e5c17e64b3f22dfb18bb934ba7e2 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sat, 19 Apr 2008 05:53:57 +0000 Subject: [PATCH] new test for zip archives with files created from stdin --- ext/phar/tests/zip/corrupt_006.phpt | 17 +++++++++++++++++ ext/phar/tests/zip/files/corrupt2.php.inc | 4 ++++ ext/phar/tests/zip/files/encrypted.zip | Bin 191 -> 191 bytes ext/phar/tests/zip/files/stdin.zip | Bin 0 -> 186 bytes 4 files changed, 21 insertions(+) create mode 100644 ext/phar/tests/zip/corrupt_006.phpt create mode 100644 ext/phar/tests/zip/files/stdin.zip diff --git a/ext/phar/tests/zip/corrupt_006.phpt b/ext/phar/tests/zip/corrupt_006.phpt new file mode 100644 index 00000000000..9c83617a9af --- /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 b396d58290e..646eb1bb93e 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 00aed14f04f0211ccc9d52ccc3c8cf86b24cf4bb..bb3727df2505836d08dcaef08e7cd56a0bd16da1 100644 GIT binary patch delta 34 kcmdnbxSx?bz?+#xgaHJOP2^T$JT_5J4M>FQ1Bq5E0FA8)WdHyG delta 34 kcmdnbxSx?bz?+#xgaHJyCvqz>W>3^p0}`S7K%&(O0DV&j`2YX_ diff --git a/ext/phar/tests/zip/files/stdin.zip b/ext/phar/tests/zip/files/stdin.zip new file mode 100644 index 0000000000000000000000000000000000000000..fdbe930983cb8a9fca4f5b6a41dd9917aef5f3e3 GIT binary patch literal 186 zcmWIWW@Zs#0D)s{lPzX=U9n^avO$;$h%+)XGBX2El(Z~;c9s<=1;QXuT#}NR7vRkZ pRF2ymh*B7t0W=a-J-VSVl?)69KxTk9D;r3J2?*nWv>S-S000o-8Djtd literal 0 HcmV?d00001