X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCustom%2FForm%2FOption.php;h=3d159429e5b567e58afcaca992562c6df10a4009;hb=3df236f629354e0f46d0291a51059cd2304b0c75;hp=ae97f4330e8c1e39befe47e9eaf4132418a150d6;hpb=5ddb2ef2c1f3e8383be54d6ee629fcbb3506c9e7;p=civicrm-core.git diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index ae97f4330e..3d159429e5 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -242,8 +242,8 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { * @access public */ static function formRule($fields, $files, $form) { - $optionLabel = CRM_Utils_Type::escape($fields['label'], 'String'); - $optionValue = CRM_Utils_Type::escape($fields['value'], 'String'); + $optionLabel = $fields['label']; + $optionValue = $fields['value']; $fieldId = $form->_fid; $optionGroupId = $form->_optionGroupID; @@ -254,7 +254,8 @@ SELECT count(*) FROM civicrm_option_value WHERE option_group_id = %1 AND label = %2"; - $params = array(1 => array($optionGroupId, 'Integer'), + $params = array( + 1 => array($optionGroupId, 'Integer'), 2 => array($optionLabel, 'String'), ); if (CRM_Core_DAO::singleValueQuery($query, $params) > 0) { @@ -266,7 +267,8 @@ SELECT count(*) FROM civicrm_option_value WHERE option_group_id = %1 AND value = %2"; - $params = array(1 => array($optionGroupId, 'Integer'), + $params = array( + 1 => array($optionGroupId, 'Integer'), 2 => array($optionValue, 'String'), ); if (CRM_Core_DAO::singleValueQuery($query, $params) > 0) { @@ -284,7 +286,8 @@ SELECT count(*) WHERE option_group_id = %1 AND id != %2 AND label = %3"; - $params = array(1 => array($optionGroupId, 'Integer'), + $params = array( + 1 => array($optionGroupId, 'Integer'), 2 => array($optionId, 'Integer'), 3 => array($optionLabel, 'String'), ); @@ -299,7 +302,8 @@ SELECT count(*) WHERE option_group_id = %1 AND id != %2 AND value = %3"; - $params = array(1 => array($optionGroupId, 'Integer'), + $params = array( + 1 => array($optionGroupId, 'Integer'), 2 => array($optionId, 'Integer'), 3 => array($optionValue, 'String'), );