jellyfin-web/dashboard-ui/bower_components/emby-apiclient/connectservice.js

34 lines
924 B
JavaScript
Raw Normal View History

2014-11-04 15:43:02 -07:00
(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);