X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FConstant.php;h=f9c96b894c3237c81c44d29f4d2815d4c8265d2e;hb=43625993dc97312d2b2296dceb7e83dcce8be27b;hp=9b4d1c225a255b08d1336f390c8090e7bf180588;hpb=898f38ad65fe945087a16062f22c66bdf9e36e77;p=civicrm-core.git diff --git a/api/v3/Constant.php b/api/v3/Constant.php index 9b4d1c225a..f9c96b894c 100644 --- a/api/v3/Constant.php +++ b/api/v3/Constant.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | + | CiviCRM version 4.6 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ @@ -48,7 +48,7 @@ function _civicrm_api3_constant_deprecation() { * @deprecated as of CiviCRM 4.4. * It's recommended to use the api getoptions action instead * - * @param string Name of a public static method of + * @param string Name of a public static method of * CRM_Core_PseudoConstant: one of * * @return array - * @example ConstantGet.php + * @example ConstantGet.php * {@getfields constant_get} */ function civicrm_api3_constant_get($params) { @@ -103,7 +103,6 @@ function civicrm_api3_constant_get($params) { //ie $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name); // once tests are 100% can try removing the first block & a similar block from Generic:getoptions - // Whitelist approach is safer $allowedClasses = array( 'CRM_Core_PseudoConstant', @@ -127,9 +126,9 @@ function civicrm_api3_constant_get($params) { } return civicrm_api3_create_success($values, $params, 'constant'); } - else{ + else { $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name); - if(!empty($values)){ + if (!empty($values)) { return civicrm_api3_create_success($values, $params, 'constant'); } } @@ -183,13 +182,12 @@ function _civicrm_api3_constant_get_spec(&$params) { 'worldRegion', 'wysiwygEditor', ); - $params = (array - ('name' => array( + $params = (array( + 'name' => array( 'title' => 'Constant Name', 'name' => 'name', 'api.required' => 1, - 'options' => array_combine($options, $options) + 'options' => array_combine($options, $options), )) ); } -