This repository was archived by the owner on Apr 12, 2024. It is now read-only.
fix($compile): correctly handle null/undefined href attrs.$set()#16520
Merged
Narretz merged 1 commit intoangular:v1.6.xfrom Apr 9, 2018
Merged
fix($compile): correctly handle null/undefined href attrs.$set()#16520Narretz merged 1 commit intoangular:v1.6.xfrom
null/undefined href attrs.$set()#16520Narretz merged 1 commit intoangular:v1.6.xfrom
Conversation
Accidentally broken while backporting angular#14890.
mgol
approved these changes
Apr 5, 2018
| (nodeName === 'img' && key === 'src')) { | ||
| // sanitize a[href] and img[src] values | ||
| this[key] = value = $$sanitizeUri(value, key === 'src'); | ||
| this[key] = value = (value == null) ? value : $$sanitizeUri(value, key === 'src'); |
Member
There was a problem hiding this comment.
Are those parens around value == null necessary? ;)
Member
Author
There was a problem hiding this comment.
No, but look how much cleaner it looks with the parens 😛
Member
There was a problem hiding this comment.
De gustibus etc. but I'm not insisting. ;)
Narretz
approved these changes
Apr 5, 2018
This was referenced Apr 18, 2018
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Accidentally broken while backporting #14890.
Since #14890,
$$sanitizeUri()can no longer handlenull/undefinedvalues.In 1.7.x, there are no such calls.
In 1.6.x, there is still one such calls inside
Attributes.$set(), so it needs to be adjusted accordingly.