mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #2175 from marshmalien/fix/1496-inconsistent-ui-character-escaping
Use textContent property instead of innerHTML within sanitize filter
This commit is contained in:
commit
4b59628075
@ -289,7 +289,7 @@ function getProjectDetails () {
|
||||
|
||||
const label = strings.get('labels.PROJECT');
|
||||
const link = `/#/projects/${project.id}`;
|
||||
const value = $filter('sanitize')(project.name);
|
||||
const value = project.name;
|
||||
const tooltip = strings.get('tooltips.PROJECT');
|
||||
|
||||
return { label, link, value, tooltip };
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
export default [function() {
|
||||
return function(input) {
|
||||
input = $("<span>").text(input)[0].innerHTML;
|
||||
input = $("<span>").text(input)[0].textContent;
|
||||
return input;
|
||||
};
|
||||
}];
|
||||
|
@ -12,6 +12,6 @@ describe('Filter: sanitize', () => {
|
||||
});
|
||||
|
||||
it('should sanitize xss-vulnerable strings', function(){
|
||||
expect(filter("<div>foobar</div>")).toBe("<div>foobar</div>");
|
||||
expect(filter("<div>foobar</div>")).toBe("<div>foobar</div>");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user