@@ -232,7 +232,10 @@ public static bool IsSslOffloadEnabled(HttpRequest request)
232232
233233 public static void OpenNewWindow ( Page page , Type type , string url )
234234 {
235- page . ClientScript . RegisterStartupScript ( type , "DotNetNuke.NewWindow" , string . Format ( "<script>window.open('{0}','new')</script>" , url ) ) ;
235+ page . ClientScript . RegisterStartupScript (
236+ type ,
237+ "DotNetNuke.NewWindow" ,
238+ $ "<script>window.open({ HttpUtility . JavaScriptStringEncode ( url , addDoubleQuotes : true ) } ,'new')</script>") ;
236239 }
237240
238241 public static string PopUpUrl ( string url , Control control , PortalSettings portalSettings , bool onClickEvent , bool responseRedirect )
@@ -267,22 +270,20 @@ public static string PopUpUrl(string url, Control control, PortalSettings portal
267270 popUpUrl = popUpUrl . Replace ( "'" , string . Empty ) ;
268271 }
269272
270- var delimiter = popUpUrl . Contains ( "?" ) ? "&" : "?" ;
271- var popUpScriptFormat = string . Empty ;
273+ var delimiter = popUpUrl . Contains ( "?" ) ? '&' : '?' ;
272274
273- // create a the querystring for use on a Response.Redirect
275+ // create the querystring for use on a Response.Redirect
274276 if ( responseRedirect )
275277 {
276- popUpScriptFormat = "{0}{1}popUp=true" ;
277- popUpUrl = string . Format ( popUpScriptFormat , popUpUrl , delimiter ) ;
278+ popUpUrl = $ "{ popUpUrl } { delimiter } popUp=true";
278279 }
279280 else
280281 {
281282 if ( ! popUpUrl . Contains ( "dnnModal.show" ) )
282283 {
283- popUpScriptFormat = "dnnModal.show('{0}{1}popUp=true',/*showReturn*/{2},{3},{4},{5},'{6}')" ;
284284 closingUrl = ( closingUrl != Null . NullString ) ? closingUrl : string . Empty ;
285- popUpUrl = "javascript:" + string . Format ( popUpScriptFormat , popUpUrl , delimiter , onClickEvent . ToString ( ) . ToLowerInvariant ( ) , windowHeight , windowWidth , refresh . ToString ( ) . ToLower ( ) , closingUrl ) ;
285+ popUpUrl =
286+ $ "javascript:dnnModal.show({ HttpUtility . JavaScriptStringEncode ( popUpUrl , addDoubleQuotes : true ) } + '{ delimiter } popUp=true',/*showReturn*/{ onClickEvent . ToString ( ) . ToLowerInvariant ( ) } ,{ windowHeight } ,{ windowWidth } ,{ refresh . ToString ( ) . ToLower ( ) } ,{ HttpUtility . JavaScriptStringEncode ( closingUrl , addDoubleQuotes : true ) } )";
286287 }
287288 else
288289 {
0 commit comments