Skip to content

Promote warnings to errors in substr_count() #4605

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

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 22, 2019

Split from #4554

@@ -5632,6 +5632,7 @@ PHP_FUNCTION(substr_count)
length += (haystack_len - offset);
}
if (length < 0 || ((size_t)length > (haystack_len - offset))) {
/* TODO Check if Candidate to convert to Exception */
php_error_docref(NULL, E_WARNING, "Invalid length value");
Copy link
Member

Choose a reason for hiding this comment

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

why is this warning not converted? invalid length is at least as serious as empty substring IMO.

@krakjoe
Copy link
Member

krakjoe commented Aug 29, 2019

TODO left and questions raised here ...

@Girgias
Copy link
Member Author

Girgias commented Aug 31, 2019

Merged in as d0754b8

@Girgias Girgias closed this Aug 31, 2019
@Girgias Girgias deleted the substr-count-warnings2errors branch August 31, 2019 21:38
Sign up for free to 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.

5 participants