karutaproject / karuta-frontend

End user interface for Karuta
Other
11 stars 16 forks source link

Public URL malformed for domains containing the same word as the value of appliname #117

Closed eviweb closed 7 years ago

eviweb commented 7 years ago

Hi, we experience an issue with public URLs. Our site URL follows the format karuta.domain.tld. The value of the appliname global variable defined in /WebContent/application/js/_init.js is left by default and its value is karuta. The problem comes from the following part of code of ./WebContent/karuta/js/karuta.js:

function sendEmailPublicURL(encodeddata,email,langcode) {
//==================================
    var url = window.location.href;
    var serverURL = url.substring(0,url.indexOf(appliname)-1);
    url = serverURL+"/"+appliname+"/application/htm/public.htm?i="+encodeddata+"&lang="+languages[langcode];

and more precisely from: var serverURL = url.substring(0,url.indexOf(appliname)-1); which keeps all characters before the pattern /appliname in our case /karuta which results in serverURL == "https:/". The entire domain is stripped. Eric

olivier-gerbe commented 7 years ago

Done.