Skip to content

Promote warnings to exceptions in ext/pcre - #6006

Closed
kocsismate wants to merge 1 commit into
php:masterfrom
kocsismate:pcre-warning
Closed

Promote warnings to exceptions in ext/pcre#6006
kocsismate wants to merge 1 commit into
php:masterfrom
kocsismate:pcre-warning

Conversation

@kocsismate

Copy link
Copy Markdown
Member

No description provided.

@kocsismatekocsismate left a comment

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus question: should we treat regex compilation errors as an exception?

Comment threadext/pcre/php_pcre.c
@nikic

Copy link
Copy Markdown
Member

I don't think we'll want to do these changes. As we don't have a dedicated function to validate a regular expression, doing a preg_match() on dummy input and checking for false is the way to do so now, and this PR would break it -- while an invalid regex itself would still return false, invalid modifiers (that are also part of the regex) would throw, etc.

Comment threadext/pcre/php_pcre.c
Comment threadext/pcre/php_pcre.c
@kocsismate
kocsismate deleted the pcre-warning branch August 25, 2020 16:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@kocsismate@nikic@salathe