diff --git a/Resource/Js/Admin.js b/Resource/Js/Admin.js index 2940177..4be6352 100644 --- a/Resource/Js/Admin.js +++ b/Resource/Js/Admin.js @@ -15,7 +15,10 @@ function getRootPath() { //判断url是否在iframe打开 if (window.frames.length == parent.frames.length) { //alert('不在iframe中' + window.document.location.href); - window.location.replace(getRootPath() + '/Views/Default?url=' + encodeURIComponent(window.document.location.href)); + var currentUrl = window.document.location.href; + if (currentUrl.startsWith(getRootPath())) { + window.location.replace(getRootPath() + '/Views/Default?url=' + encodeURIComponent(currentUrl)); + } //window.location.replace(getRootPath() + '/Views/Default?url=' + window.document.location.href); } diff --git a/Resource/fullcalendar/examples/google-calendar.html b/Resource/fullcalendar/examples/google-calendar.html index b6a686a..5e77f3b 100644 --- a/Resource/fullcalendar/examples/google-calendar.html +++ b/Resource/fullcalendar/examples/google-calendar.html @@ -22,7 +22,7 @@ // THIS KEY WON'T WORK IN PRODUCTION!!! // To make your own Google API key, follow the directions here: // http://fullcalendar.io/docs/google_calendar/ - googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE', + googleCalendarApiKey: process.env.GOOGLE_CALENDAR_API_KEY || '', // US Holidays events: 'en.usa#holiday@group.v.calendar.google.com', diff --git a/Scripts/WebForms/SmartNav.js b/Scripts/WebForms/SmartNav.js index 23b6487..5e87f4e 100644 --- a/Scripts/WebForms/SmartNav.js +++ b/Scripts/WebForms/SmartNav.js @@ -31,7 +31,9 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null)) var fdurlb = fdurl.split("?")[0]; if (document.location.href.indexOf(fdurlb) < 0) { - document.location.href=fdurl; + // Sanitize the URL before redirecting + var sanitizedUrl = new URL(fdurl, window.location.origin).href; + document.location.href = sanitizedUrl; return; } sn._savedOnLoad = window.onload; diff --git a/Views/Default.aspx b/Views/Default.aspx index a624f6f..8e9b49e 100644 --- a/Views/Default.aspx +++ b/Views/Default.aspx @@ -73,7 +73,7 @@ <%----%> - <%= Notice %> + <%= HttpUtility.HtmlEncode(Notice) %>