-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix PHP 8.5 recursive tokenization during token_get_all
#19547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -766,6 +769,8 @@ ZEND_API void zend_prepare_string_for_scanning(zval *str, zend_string *filename) | |||
zend_set_compiled_filename(filename); | |||
CG(zend_lineno) = 1; | |||
CG(increment_lineno) = 0; | |||
SCNG(on_event) = NULL; | |||
SCNG(on_event_context) = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also reset SCNG(on_event_context)
here:
php-src/Zend/zend_language_scanner.l
Line 2761 in 43a7a9a
LANG_SCNG(on_event) = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (I hope).
Please also add a test where the error handler throws an exception |
Co-authored-by: Arnaud Le Blanc <[email protected]>
Thank you @kubawerlos! |
@@ -1636,6 +1641,9 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_ | |||
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}("integer"){TABS_AND_SPACES}")" { | |||
if (PARSER_MODE()) { | |||
zend_error(E_DEPRECATED, "Non-canonical cast (integer) is deprecated, use the (int) cast instead"); | |||
if (PARSER_MODE() && EG(exception)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PARSER_MODE()
condition not required, checked already above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #19507
Changes for the fix are authored by @arnaud-lb in #19507 (comment).
@arnaud-lb, if you were planning to raise the PR by yourself, feel free to close this PR and do it.