From: adixon Date: Fri, 17 Feb 2017 15:19:35 +0000 (-0500) Subject: CRM-20040 Handle apostrophes and double double quotes in on behalf of Org fields X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d425f39be02a78e3faa8512590613a0f6bd8fe0c;p=civicrm-core.git CRM-20040 Handle apostrophes and double double quotes in on behalf of Org fields --- diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 9465253007..9d8e25dd52 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -891,7 +891,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { if (!empty($form->_submitValues['onbehalfof_id'])) { $form->assign('submittedOnBehalf', $form->_submitValues['onbehalfof_id']); } - $form->assign('submittedOnBehalfInfo', json_encode($form->_submitValues['onbehalf'])); + $form->assign('submittedOnBehalfInfo', json_encode(str_replace('"', '\"', $form->_submitValues['onbehalf']), JSON_HEX_APOS)); } $fieldTypes = array('Contact', 'Organization');