[4.3] Fixing comparison in Url Filter#40229
Merged
obuisard merged 3 commits intojoomla:4.3-devfrom Mar 29, 2023
Merged
Conversation
Member
Author
|
Why make the code easy, when you can also make it difficult... I changed the ! to the ===... |
Contributor
|
I have not tested this item. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40229. |
Contributor
|
I have tested this item ✅ successfully on d972072 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40229. |
rdeutz
reviewed
Mar 29, 2023
Contributor
|
I have tested this item ✅ successfully on d972072 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40229. |
Contributor
|
Thank you Hannes @Hackwar |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of Changes
phpstan reported an issue. The comparison in the changed line is currently broken. The way the operators are used, the type attribute is first cast from a SimpleXMLElement to a string, then negated as a boolean and then compared against a string. Thus the comparison is always wrong. With the added parentheses, the comparison is actually working again.
Testing Instructions
Codereview
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed