mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix GH-14189: PHP Interactive shell input state incorrectly handles quoted heredoc literals.
Only `'` was handled, no handling case for `"` existed. Simply add it so the heredoc tag is set up correctly. Closes GH-14195.
This commit is contained in:
parent
15813d69a5
commit
217b753a3d
3 changed files with 49 additions and 0 deletions
44
sapi/cli/tests/gh14189.phpt
Normal file
44
sapi/cli/tests/gh14189.phpt
Normal file
|
@ -0,0 +1,44 @@
|
|||
--TEST--
|
||||
GH-14189 (PHP Interactive shell input state incorrectly handles quoted heredoc literals.)
|
||||
--EXTENSIONS--
|
||||
readline
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include "skipif.inc";
|
||||
if (readline_info('done') === NULL) {
|
||||
die ("skip need readline support");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$php = getenv('TEST_PHP_EXECUTABLE');
|
||||
|
||||
// disallow console escape sequences that may break the output
|
||||
putenv('TERM=VT100');
|
||||
|
||||
$code = <<<EOT
|
||||
\$test = <<<"EOF"
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
EOF;
|
||||
echo \$test;
|
||||
exit
|
||||
EOT;
|
||||
|
||||
$code = escapeshellarg($code);
|
||||
echo `echo $code | "$php" -a`, "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Interactive shell
|
||||
|
||||
php > $test = <<<"EOF"
|
||||
<<< > foo
|
||||
<<< > bar
|
||||
<<< > baz
|
||||
<<< > EOF;
|
||||
php > echo $test;
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
php > exit
|
Loading…
Add table
Add a link
Reference in a new issue