<?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$
*
*/
/**
* global validation rules for the form
*
- * @param array $fields posted values of the form
- * @param array $errors list of errors to be posted back to the form
+ * @param array $fields posted values of the form
+ * @param array $errors list of errors to be posted back to the form
*
- * @return $errors
- * @static
+ * @return array $errors@static
* @access public
*/
static function formRule($fields, $errors) {
$hasData = $hasPrimary = $errors = array();
- if (CRM_Utils_Array::value('email', $fields) && is_array($fields['email'])) {
+ if (!empty($fields['email']) && is_array($fields['email'])) {
foreach ($fields['email'] as $instance => $blockValues) {
$dataExists = CRM_Contact_Form_Contact::blockDataExists($blockValues);
if ($dataExists) {
$hasData[] = $instance;
- if (CRM_Utils_Array::value('is_primary', $blockValues)) {
+ if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
}
}