Skip to content
Snippets Groups Projects
Verified Commit 83f4fcc9 authored by mattwire's avatar mattwire Committed by Kevin Cristiano
Browse files

Use a more unique placeholder url path for CiviCRM AJAX requests

parent 9224c3e2
No related branches found
No related tags found
No related merge requests found
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
// Remove basepage as it can be changed on some CMS eg. WordPress frontend. // Remove basepage as it can be changed on some CMS eg. WordPress frontend.
frag[0] = frag[0].replace('civicrm/', '/'); frag[0] = frag[0].replace('civicrm/', '/');
// Encode url path only if slashes in placeholder were also encoded // Encode url path only if slashes in placeholder were also encoded
if (tplURL[mode].indexOf('/placeholder-url-path') >= 0) { if (tplURL[mode].indexOf('/crmajax-placeholder-url-path') >= 0) {
url = tplURL[mode].replace('/placeholder-url-path', frag[0]); url = tplURL[mode].replace('/crmajax-placeholder-url-path', frag[0]);
} else { } else {
url = tplURL[mode].replace('%2Fplaceholder-url-path', encodeURIComponent(frag[0])); url = tplURL[mode].replace('%2Fcrmajax-placeholder-url-path', encodeURIComponent(frag[0]));
} }
if (_.isEmpty(query)) { if (_.isEmpty(query)) {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim}); CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim});
// Initialize CRM.url and CRM.formatMoney // Initialize CRM.url and CRM.formatMoney
CRM.url({ldelim}back: '{crmURL p="civicrm/placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fb=1}', front: '{crmURL p="civicrm/placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fe=1}'{rdelim}); CRM.url({ldelim}back: '{crmURL p="civicrm/crmajax-placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fb=1}', front: '{crmURL p="civicrm/crmajax-placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fe=1}'{rdelim});
CRM.formatMoney('init', false, {$moneyFormat|@json_encode}); CRM.formatMoney('init', false, {$moneyFormat|@json_encode});
// Localize select2 // Localize select2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment