-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixed a bug where a newline was treated as a valid value even if it was included at the end. #4094
Merged
MGatner
merged 2 commits into
codeigniter4:develop
from
ytetsuro:fix/NewlinesAtTheEndAreIncludInThePatternMatch
Jan 16, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 add
@see https://regex101.com/
link comment so it will be easier to verify in the future if bug/improvement neededThere 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.
@samsonasik
Do we write this link in the code where all the regular expressions are written?
I don't see the need to add a link.
I think the attached URL is maintained by an individual, but how long will it be valid?
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.
You can check these:
CodeIgniter4/system/View/Parser.php
Line 576 in 3119fc8
CodeIgniter4/system/View/Parser.php
Line 742 in 3119fc8
CodeIgniter4/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php
Line 28 in 3119fc8
Yes, not everwhere yet, but I think it will be better to add it whenever possible for better future.
I've no information about how long it will be valid, but it seems it long enough ,for example, this is from 5 years ago https://regex101.com/library/wL5mP7 .
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.
Will this link really be easy to maintain?
Every time a regular expression is edited, does the URL also need to be maintained, and will all the maintainers review and manage it?
The system also has the ability to delete the URLs that are created.
After the merge, if the link is deleted, the information will be lost.
I think test code is more constructive than a link that may or may not work.
What do other MEMBERS think about this?
I don't want to add this URL as my commit, but I will reluctantly add it if many members agree with this.
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.
I vote for adding the link.
As it is positioned directly above the code I would think it is implicit to maintain it (or at least see what it does) when changing the regex itself.
Also, while of course the link might point to a dead end some future day, I consider it to be better to provide information that might get lost instead of not providing info at all in the first place.
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.
It would be nice to have a link. It will make our life easier in the future.
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.
Thanks for giving me your input.
I have added your comment.