From: Coleman Watts Date: Thu, 21 Nov 2013 02:26:23 +0000 (-0800) Subject: CRM-13807 - Verify BAO exists in api getBAO X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d9f036bb25973bdd57b998c4f19e22d413c4536b;p=civicrm-core.git CRM-13807 - Verify BAO exists in api getBAO --- diff --git a/api/v3/utils.php b/api/v3/utils.php index 36e84b9080..4c7d369978 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -307,8 +307,9 @@ function _civicrm_api3_get_DAO($name) { */ function _civicrm_api3_get_BAO($name) { $dao = _civicrm_api3_get_DAO($name); - $dao = str_replace("DAO", "BAO", $dao); - return $dao; + $bao = str_replace("DAO", "BAO", $dao); + $file = str_replace('_', '/', $dao) . '.php'; + return file_exists($file) ? $bao : $dao; } /**