mirror of
https://github.com/php/php-src.git
synced 2026-04-04 06:32:49 +02:00
Merge branch 'PHP-5.5'
This commit is contained in:
21
Zend/tests/bug64677.phpt
Normal file
21
Zend/tests/bug64677.phpt
Normal file
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #64677 (execution operator `` stealing surrounding arguments)
|
||||
--FILE--
|
||||
<?PHP
|
||||
class cat {
|
||||
public function show_output($prepend, $output = '') {
|
||||
}
|
||||
}
|
||||
$cat = new cat();
|
||||
$cat->show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec
|
||||
$cat->show_output('Files: ', `cd .`); // this causes a segmentation fault
|
||||
$cat->show_output(`cd .`); // this causes a segmentation fault
|
||||
|
||||
function show_outputa($prepend, $output) {
|
||||
echo "Okey";
|
||||
}
|
||||
show_outputa('Files: ', `cd .`); // this works as expected
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Okey
|
||||
@@ -5702,6 +5702,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
|
||||
GET_CACHE_SLOT(opline->op1.constant);
|
||||
opline->extended_value = 1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.num = CG(context).nested_calls;
|
||||
GET_NODE(result, opline->result);
|
||||
|
||||
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
|
||||
|
||||
Reference in New Issue
Block a user