CRM-20040 Handle apostrophes and double double quotes in on behalf of Org fields
authoradixon <alan.g.dixon@gmail.com>
Fri, 17 Feb 2017 15:19:35 +0000 (10:19 -0500)
committeradixon <alan.g.dixon@gmail.com>
Fri, 17 Feb 2017 15:19:35 +0000 (10:19 -0500)
CRM/Contribute/Form/ContributionBase.php

index 9465253007306f95158d13b46f07d9e5e06fcb9e..9d8e25dd52209908e1967c2e9d91885e793f38bb 100644 (file)
@@ -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');