Merge pull request #2319 from coreos-inc/FIX-escapehtmlstring-type-error
fix(js/util-service): ensure text is a string
This commit is contained in:
commit
0150abc488
1 changed files with 2 additions and 1 deletions
|
@ -75,7 +75,8 @@ angular.module('quay').factory('UtilService', ['$sanitize', function($sanitize)
|
||||||
};
|
};
|
||||||
|
|
||||||
utilService.escapeHtmlString = function(text) {
|
utilService.escapeHtmlString = function(text) {
|
||||||
var adjusted = text.replace(/&/g, "&")
|
var textStr = (text || '').toString();
|
||||||
|
var adjusted = textStr.replace(/&/g, "&")
|
||||||
.replace(/</g, "<")
|
.replace(/</g, "<")
|
||||||
.replace(/>/g, ">")
|
.replace(/>/g, ">")
|
||||||
.replace(/"/g, """)
|
.replace(/"/g, """)
|
||||||
|
|
Reference in a new issue