Browse Source
Move shebang handling into the lexer
Move shebang handling into the lexer
Instead of handling shebang lines by adjusting the file pointer in individual SAPIs, move the handling into the lexer, where this is both a lot simpler and more robust. Whether the shebang should be skipped is controlled by CG(skip_shebang) -- we might want to do that in more cases. This fixed bugs #60677 and #78066.pull/4417/head
9 changed files with 48 additions and 170 deletions
-
4NEWS
-
2Zend/zend_compile.c
-
2Zend/zend_globals.h
-
37Zend/zend_language_scanner.l
-
10main/main.c
-
73sapi/cgi/cgi_main.c
-
9sapi/cgi/tests/bug60677.phpt
-
34sapi/cli/php_cli.c
-
47sapi/phpdbg/phpdbg_prompt.c
@ -0,0 +1,9 @@ |
|||
--TEST-- |
|||
Bug #60677: CGI doesn't properly validate shebang line contains #! |
|||
--CGI-- |
|||
--FILE-- |
|||
#<?php echo "Hello World\n"; ?> |
|||
Second line. |
|||
--EXPECT-- |
|||
#Hello World |
|||
Second line. |
Write
Preview
Loading…
Cancel
Save
Reference in new issue