jellyfin-web/dashboard-ui/bower_components/emby-apiclient/connectservice.js
2015-12-23 15:07:03 -05:00

26 lines
753 B
JavaScript

define([], function () {
function replaceAll(str, find, replace) {
return str.split(find).join(replace);
}
return {
cleanPassword: function (password) {
password = password || '';
password = replaceAll(password, "&", "&");
password = replaceAll(password, "/", "\");
password = replaceAll(password, "!", "!");
password = replaceAll(password, "$", "$");
password = replaceAll(password, "\"", """);
password = replaceAll(password, "<", "&lt;");
password = replaceAll(password, ">", "&gt;");
password = replaceAll(password, "'", "&#39;");
return password;
}
};
});