Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngSanitize): ensure html is a string in htmlParser() #8417

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jul 30, 2014

Previously, $sanitize(nonString) would throw. Now, the type is converted to a
string before any work is done.

Closes #8416

@caitp caitp added this to the 1.3.0 milestone Jul 30, 2014
@caitp caitp added cla: yes and removed cla: no labels Jul 30, 2014
expectHTML(undefined).toBe('');
expectHTML(42).toBe('42');
expectHTML({}).toBe('[object Object]');
expectHTML([1, 2, 3]).toBe('1,2,3');
Copy link
Contributor

Choose a reason for hiding this comment

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

Add test for bool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jeffbcross
Copy link
Contributor

Other than adding a test for boolean values for completeness, LGTM

Previously, $sanitize(nonString) would throw. Now, the type is converted to a string before any work
is done.
caitp added a commit that referenced this pull request Jul 30, 2014
Previously, $sanitize(nonString) would throw. Now, the type is converted to a string before any work
is done.

Closes #8417
Closes #8416
@caitp caitp closed this in 34781f1 Jul 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngSanitize throws TypeError when trying to use ng-bind-html w/ Number.
2 participants