X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2Futils.php;h=31c5d626da28e574d3326e3b9c2164e80d13282f;hb=9c7ec7086d8984dcc3dc11f643bfa0f4b3c6eeda;hp=eaf8b771bb3c8191e47ab57506b240610376cd3e;hpb=dc5673b7f53578581c8c8915ca7c4da67a28a4de;p=civicrm-core.git diff --git a/api/v3/utils.php b/api/v3/utils.php index eaf8b771bb..31c5d626da 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1574,12 +1574,9 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent function _civicrm_api3_resolve_contactID($contactIdExpr) { //if value = 'user_contact_id' replace value with logged in user id if ($contactIdExpr == "user_contact_id") { - $session = &CRM_Core_Session::singleton(); - if (!is_numeric($session->get('userID'))) { - return NULL; - } - return $session->get('userID'); - } elseif (preg_match('/^@user:(.*)$/', $contactIdExpr, $matches)) { + return CRM_Core_Session::getLoggedInContactID(); + } + elseif (preg_match('/^@user:(.*)$/', $contactIdExpr, $matches)) { $config = CRM_Core_Config::singleton(); $ufID = $config->userSystem->getUfId($matches[1]);