mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 16:54:01 +08:00
Feature - Google Analytics - Simplified Module & Escaped the Script to prevent XXS.
This commit is contained in:
@@ -56,7 +56,10 @@ class StatusPage extends BeanModel {
|
||||
|
||||
await StatusPage.getStatusPageData(statusPage).then( (page) => {
|
||||
if (page.config?.googleAnalyticsId) {
|
||||
head.append($(googleAnalytics.getGoogleAnalyticsScript(page.config.googleAnalyticsId)));
|
||||
let escapedGoogleAnalyticsScript = jsesc(googleAnalytics.getGoogleAnalyticsScript(page.config.googleAnalyticsId), {
|
||||
"isScriptContext": true
|
||||
});
|
||||
head.append($(escapedGoogleAnalyticsScript));
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user