From dd11d4f64e97230b12da2574447775d483d81b5c Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sat, 5 Jan 2008 05:12:44 +0000 Subject: [PATCH] new test --- ext/phar/phar_object.c | 1 + ext/phar/tests/frontcontroller10.phpt | 17 +++++++++++++++++ ext/phar/tests/frontcontroller3.phar | Bin 342 -> 342 bytes ext/phar/tests/frontcontroller4.phar | Bin 0 -> 338 bytes ext/phar/tests/frontcontroller4.phar.inc | 12 ++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 ext/phar/tests/frontcontroller10.phpt create mode 100644 ext/phar/tests/frontcontroller4.phar create mode 100644 ext/phar/tests/frontcontroller4.phar.inc diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 156145f84d..4532e6a1d5 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -477,6 +477,7 @@ PHP_METHOD(Phar, webPhar) if (SUCCESS == zend_hash_find(Z_ARRVAL_P(rewrites), entry, entry_len+1, (void **) &fd_ptr)) { if (IS_STRING != Z_TYPE_PP(fd_ptr)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "phar rewrite value for \"%s\" was not a string", entry); + return; } if (entry != index_php) { efree(entry); diff --git a/ext/phar/tests/frontcontroller10.phpt b/ext/phar/tests/frontcontroller10.phpt new file mode 100644 index 0000000000..a0c53afb73 --- /dev/null +++ b/ext/phar/tests/frontcontroller10.phpt @@ -0,0 +1,17 @@ +--TEST-- +Phar front controller rewrite array invalid +--SKIPIF-- + +--ENV-- +SCRIPT_NAME=/frontcontroller10.php/hi +REQUEST_URI=/frontcontroller10.php/hi +--FILE_EXTERNAL-- +frontcontroller4.phar +--EXPECTHEADERS-- +Content-type: text/html +--EXPECTF-- +Fatal error: Uncaught exception 'UnexpectedValueException' with message 'phar rewrite value for "/hi" was not a string' in %sfrontcontroller10.php:2 +Stack trace: +#0 %sfrontcontroller10.php(2): Phar::webPhar('whatever', 'index.php', '', Array, Array) +#1 {main} + thrown in %sfrontcontroller10.php on line 2 \ No newline at end of file diff --git a/ext/phar/tests/frontcontroller3.phar b/ext/phar/tests/frontcontroller3.phar index 41c43d9da5b87a965bbae9d067149b90a81cd94b..69908c02ab0d0ac55527f85d5de401b9e2c1e402 100644 GIT binary patch delta 54 zcmcb{bd71kaVC9^i6`Yj|DL=oUSRo}dMIkT0M4_lOFD6gPnyW0a zC_be$w?IQB-qkNmM?ob%*fl83H3+CHKHkI8CnVn4-#5V1$2CYp(^|paj+d*9fq{V; zhy{U|5r`px6-Xt590iiPDp2nZqSwCPeqkF_4Mag!K{_r4Y%mjw#h^xjXyKg31eg&S znfX9u0}3C7w9>rflFa-(1)zwAW_4|hL4$6_L^l63VQ-WQ%5OO{K1$?f0_t~n@^u0L D`=(k+ literal 0 HcmV?d00001 diff --git a/ext/phar/tests/frontcontroller4.phar.inc b/ext/phar/tests/frontcontroller4.phar.inc new file mode 100644 index 0000000000..5d9728cb19 --- /dev/null +++ b/ext/phar/tests/frontcontroller4.phar.inc @@ -0,0 +1,12 @@ +setStub(' true)); +echo "oops did not run\n"; +var_dump($_ENV, $_SERVER); +__HALT_COMPILER();'); +?> -- 2.50.1