From b26a113f19390f0cc0ee5db48b0a15b2ebbd6ec2 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 5 Aug 2016 15:41:49 +0530 Subject: [PATCH] CRM-19176 - Additional fixes --- CRM/Contribute/Form/Task/PDFLetterCommon.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index 900ab12169..b93bd533a0 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -35,14 +35,15 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF $updateStatus = ''; $task = 'CRM_Contribution_Form_Task_PDFLetterCommon'; $realSeparator = ', '; + $tableSeparators = array( + 'td' => '', + 'tr' => '', + ); //the original thinking was mutliple options - but we are going with only 2 (comma & td) for now in case // there are security (& UI) issues we need to think through if (isset($formValues['group_by_separator'])) { - if ($formValues['group_by_separator'] == 'td') { - $realSeparator = ""; - } - elseif ($formValues['group_by_separator'] == 'tr') { - $realSeparator = ""; + if (in_array($formValues['group_by_separator'], array('td', 'tr'))) { + $realSeparator = $tableSeparators[$formValues['group_by_separator']]; } elseif ($formValues['group_by_separator'] == 'br') { $realSeparator = "
"; @@ -75,7 +76,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF self::assignCombinedContributionValues($contact, $contributions, $groupBy, $groupByID); if (empty($groupBy) || empty($contact['is_sent'][$groupBy][$groupByID])) { - if (!$validated && $realSeparator == '' && !self::isValidHTMLWithTableSeparator($messageToken, $html_message)) { + if (!$validated && in_array($realSeparator, $tableSeparators) && !self::isValidHTMLWithTableSeparator($messageToken, $html_message)) { $realSeparator = ', '; CRM_Core_Session::setStatus(ts('You have selected the table cell separator, but one or more token fields are not placed inside a table cell. This would result in invalid HTML, so comma separators have been used instead.')); } -- 2.25.1