Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix to mwf.server for redirect with infinite loop protection [#135]

  • Loading branch information...
commit e84b801d5628d4a63c1271b75b51c4855015f04e 1 parent c7a9b18
@ebollens ebollens authored
View
2  root/assets/js/core/server.js
@@ -1 +1 @@
-mwf.server=new function(){this.cookieNameLocal=mwf.site.cookie.prefix+"server";this.mustRedirect=false;this.mustReload=false;var b=mwf.site,d=mwf.classification,c=mwf.userAgent,a=mwf.screen;this.init=function(){if(!mwf.capability.cookie()){return}var g=window.location.href.split("?")[1];if(typeof g!="undefined"){var h=g.split("&");for(var f=0;f<h.length;f++){if(h[f].split("=")[0]=="no_server_init"){return}}}var e=d.generateCookieContent();if(!b.cookie.exists(d.cookieName)||b.cookie.classification!=e){this.setCookie(d.cookieName,e)}if(!b.cookie.exists(c.cookieName)){this.setCookie(c.cookieName,c.generateCookieContent())}if(!b.cookie.exists(a.cookieName)){this.setCookie(a.cookieName,a.generateCookieContent())}if(this.mustReload&&!mwf.override.isRedirecting){var j=window.location.href;if(j.indexOf("?")==-1){j+="?"}if(j.indexOf("?")<j.length-1){j+="&"}j+="no_server_init"}else{if(this.mustRedirect&&!mwf.override.isRedirecting){window.location=b.asset.root+"/passthru.php?return="+encodeURIComponent(window.location)+"&mode="+mwf.browser.getMode()}}};this.setCookie=function(g,e){var f=mwf.site.local.isSameOrigin();if(f){document.cookie=g+"="+encodeURIComponent(e)+";path=/";this.mustReload=true}else{this.mustRedirect=true}}};mwf.server.init();
View
1  root/assets/js/core/server.src.js
@@ -100,6 +100,7 @@ mwf.server = new function(){
if(loc.indexOf('?') == -1) loc += "?";
if(loc.indexOf('?') < loc.length-1) loc += "&";
loc += "no_server_init";
+ window.location = loc;
}else if(this.mustRedirect && !mwf.override.isRedirecting){
window.location = site.asset.root+'/passthru.php?return='+encodeURIComponent(window.location)+'&mode='+mwf.browser.getMode();
}
Please sign in to comment.
Something went wrong with that request. Please try again.