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
optimized some ignore rules in the phpstan-baseline.neon
#456
optimized some ignore rules in the phpstan-baseline.neon
#456
Conversation
$limited = ini_get('pcre.backtrack_limit'); | ||
ini_set('pcre.backtrack_limit', '4'); | ||
$things = ['"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"']; | ||
self::assertSame(['"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"'], Psr7\Header::normalize($things)); |
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.
This assertion is bogus. However the backtrack limit is a good reason to not rely on regular expressions here. See: #447
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.
Agree. Rely on the regular expression may not a good idea. For example, parsing the new Permissions-Policy's value, eg: Permissions-Policy: fullscreen=(self "https://example.com" "https://another.example.com"), geolocation=*, camera=()
, there were the parentheses, self
, none
, empty string and double quotes strings, it shall be so hard to do that.
phpstan-baseline.neon
phpstan-baseline.neon
There are a lot of changes here, and it's not clear if any bugs are actually fixed. Since there are merge conflicts, we're not able to merge at this time. Please feel free to re-submit a PR fixing a specific bug. |
phpstan-baseline.neon
;pcre.backtrack_limit
settings may be affected the functionpreg_split
's behavior. While there were a customized value (less than 5), it can caused theHeader::parse
andHeader::normalize
working incorrectly. Optimize codes for this case.