- var frag = path.split('?');
- var url = tplURL[mode].replace("civicrm-placeholder-url-path", frag[0]);
+ var url,
+ frag = path.split('?');
+ // Encode url path only if slashes in placeholder were also encoded
+ if (tplURL[mode].indexOf('civicrm/placeholder-url-path') >= 0) {
+ url = tplURL[mode].replace('civicrm/placeholder-url-path', frag[0]);
+ } else {
+ url = tplURL[mode].replace('civicrm%2Fplaceholder-url-path', encodeURIComponent(frag[0]));
+ }