From ce5732112e449bb2cd80136f9beeaa7fa2fecc82 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Wed, 23 Apr 2008 16:47:12 +0000 Subject: [PATCH] new test for invalid rewrite callback --- ext/phar/phar_object.c | 1 - ext/phar/tests/files/frontcontroller16.phar | Bin 0 -> 330 bytes ext/phar/tests/files/frontcontroller16.phar.inc | 16 ++++++++++++++++ ext/phar/tests/frontcontroller31.phpt | 13 +++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ext/phar/tests/files/frontcontroller16.phar create mode 100644 ext/phar/tests/files/frontcontroller16.phar.inc create mode 100644 ext/phar/tests/frontcontroller31.phpt diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 8df06f3f56..35b8cbd53e 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -560,7 +560,6 @@ PHP_METHOD(Phar, webPhar) if (!(SG(request_info).request_method && SG(request_info).request_uri && (!strcmp(SG(request_info).request_method, "GET") || !strcmp(SG(request_info).request_method, "POST")))) { return; } - #ifdef PHP_WIN32 fname = estrndup(fname, fname_len); phar_unixify_path_separators(fname, fname_len); diff --git a/ext/phar/tests/files/frontcontroller16.phar b/ext/phar/tests/files/frontcontroller16.phar new file mode 100644 index 0000000000000000000000000000000000000000..66fc1457082df566e95aee9f46ace7fdf7a4dff3 GIT binary patch literal 330 zcmcDqFUTn1Dk-W|sOAdDNG!6lDo;%UF*KA)Qj1IU3V=){9R(%*%)FG;3Lv)t$jd9u z$wa^E2LzmDCFgrC=`|E z0cEYZ$`Xs>Q%Z9SG*seU{latcfcoO&Jsf>P;+_3{13Z0PgETa)73}SJ zxy%_D7#M+A5K03nAm9XIxR*dum*V+7K(trbmF{gI^*~?)4jhPUGBSa-&)vRc@s8(y Z@8#699J{Uk3mH literal 0 HcmV?d00001 diff --git a/ext/phar/tests/files/frontcontroller16.phar.inc b/ext/phar/tests/files/frontcontroller16.phar.inc new file mode 100644 index 0000000000..3c9986da00 --- /dev/null +++ b/ext/phar/tests/files/frontcontroller16.phar.inc @@ -0,0 +1,16 @@ +setStub('getMessage() . "\n"); +} +echo "oops did not run\n"; +var_dump($_ENV, $_SERVER); +__HALT_COMPILER();'); +?> diff --git a/ext/phar/tests/frontcontroller31.phpt b/ext/phar/tests/frontcontroller31.phpt new file mode 100644 index 0000000000..6ec7ca1b6f --- /dev/null +++ b/ext/phar/tests/frontcontroller31.phpt @@ -0,0 +1,13 @@ +--TEST-- +Phar front controller with invalid callback for rewrites +--SKIPIF-- + +--ENV-- +SCRIPT_NAME=/frontcontroller31.php +REQUEST_URI=/frontcontroller31.php +--EXPECTHEADERS-- +Content-type: text/html +--FILE_EXTERNAL-- +files/frontcontroller16.phar +--EXPECT-- +phar error: invalid rewrite callback \ No newline at end of file -- 2.50.1