mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
new test for invalid rewrite callback
This commit is contained in:
@@ -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);
|
||||
|
||||
BIN
ext/phar/tests/files/frontcontroller16.phar
Normal file
BIN
ext/phar/tests/files/frontcontroller16.phar
Normal file
Binary file not shown.
16
ext/phar/tests/files/frontcontroller16.phar.inc
Normal file
16
ext/phar/tests/files/frontcontroller16.phar.inc
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . '/frontcontroller16.phar');
|
||||
$a = new Phar(dirname(__FILE__) . '/frontcontroller16.phar');
|
||||
$a['index.php'] = '<?php
|
||||
echo "hi";
|
||||
';
|
||||
$a->setStub('<?php
|
||||
try {
|
||||
Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
|
||||
} catch (Exception $e) {
|
||||
die($e->getMessage() . "\n");
|
||||
}
|
||||
echo "oops did not run\n";
|
||||
var_dump($_ENV, $_SERVER);
|
||||
__HALT_COMPILER();');
|
||||
?>
|
||||
13
ext/phar/tests/frontcontroller31.phpt
Normal file
13
ext/phar/tests/frontcontroller31.phpt
Normal file
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Phar front controller with invalid callback for rewrites
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
--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
|
||||
Reference in New Issue
Block a user