<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id: $
*
*/
*
* @param $type integer datatype
*
- * @return $string String datatype respective to integer datatype
- *
- * @access public
+ * @return string $string String datatype respective to integer datatype@access public
* @static
*/
static function typeToString($type) {
// CRM-8925 the 3 below are for custom fields of this type
case 'Country':
case 'StateProvince':
+ // Checked for multi valued state/country value
+ if (is_array($data)) {
+ $returnData = TRUE;
+ foreach ($data as $data) {
+ if (CRM_Utils_Rule::positiveInteger($data) || CRM_Core_DAO::escapeString($data)) {
+ $returnData = TRUE;
+ }
+ else {
+ $returnData = FALSE;
+ }
+ }
+ if ($returnData) {
+ return $data;
+ }
+ }
+ elseif (!is_numeric($data) && CRM_Core_DAO::escapeString($data)) {
+ return $data;
+ }
+ elseif (CRM_Utils_Rule::positiveInteger($data)) {
+ return $data;
+ }
+ break;
+
case 'File':
if (CRM_Utils_Rule::positiveInteger($data)) {
return $data;