From: Greg Beaver Date: Sat, 5 Jan 2008 05:12:44 +0000 (+0000) Subject: new test X-Git-Tag: RELEASE_2_0_0a1~1021 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd11d4f64e97230b12da2574447775d483d81b5c;p=php new test --- 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 41c43d9da5..69908c02ab 100644 Binary files a/ext/phar/tests/frontcontroller3.phar and b/ext/phar/tests/frontcontroller3.phar differ diff --git a/ext/phar/tests/frontcontroller4.phar b/ext/phar/tests/frontcontroller4.phar new file mode 100644 index 0000000000..34605264a2 Binary files /dev/null and b/ext/phar/tests/frontcontroller4.phar differ 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();'); +?>