|
|
@ -39,8 +39,8 @@ utility = function () {
|
|
|
|
PrivilegedCarbonContext.startTenantFlow();
|
|
|
|
PrivilegedCarbonContext.startTenantFlow();
|
|
|
|
context = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
context = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
|
|
context.setTenantDomain(carbon.server.tenantDomain({
|
|
|
|
context.setTenantDomain(carbon.server.tenantDomain({
|
|
|
|
tenantId: userInfo.tenantId
|
|
|
|
tenantId: userInfo.tenantId
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
context.setTenantId(userInfo.tenantId);
|
|
|
|
context.setTenantId(userInfo.tenantId);
|
|
|
|
context.setUsername(userInfo.username || null);
|
|
|
|
context.setUsername(userInfo.username || null);
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -161,15 +161,19 @@ utility = function () {
|
|
|
|
* @returns {*}
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
publicMethods.encodeJson = function (text) {
|
|
|
|
publicMethods.encodeJson = function (text) {
|
|
|
|
return text
|
|
|
|
if (text) {
|
|
|
|
.replace(/\\u003c/g, "<")
|
|
|
|
return text
|
|
|
|
.replace(/</g, "<")
|
|
|
|
.replace(/\\u003c/g, "<")
|
|
|
|
.replace(/\\u003e/g, ">")
|
|
|
|
.replace(/</g, "<")
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
.replace(/\\u003e/g, ">")
|
|
|
|
.replace(/\\u0027/g, "'")
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
.replace(/'/g, "'")
|
|
|
|
.replace(/\\u0027/g, "'")
|
|
|
|
.replace(/\\"/g, """)
|
|
|
|
.replace(/'/g, "'")
|
|
|
|
.replace(/\\u0022/g, """)
|
|
|
|
.replace(/\\"/g, """)
|
|
|
|
|
|
|
|
.replace(/\\u0022/g, """);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return publicMethods;
|
|
|
|
return publicMethods;
|
|
|
|