mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
new test for invalid rewrite callback
This commit is contained in:
parent
50835e4bb7
commit
ce5732112e
4 changed files with 29 additions and 1 deletions
|
@ -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")))) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PHP_WIN32
|
#ifdef PHP_WIN32
|
||||||
fname = estrndup(fname, fname_len);
|
fname = estrndup(fname, fname_len);
|
||||||
phar_unixify_path_separators(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
|
Loading…
Add table
Add a link
Reference in a new issue