jellyfin-web/dashboard-ui/thirdparty/apiclient/connectservice.js
2014-11-04 17:43:02 -05:00

34 lines
924 B
JavaScript

(function (globalScope) {
if (!globalScope.MediaBrowser) {
globalScope.MediaBrowser = {};
}
function replaceAll(str, find, replace) {
return str.split(find).join(replace);
}
var connectService = {
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;
}
};
globalScope.MediaBrowser.ConnectService = connectService;
})(window);