From d9f036bb25973bdd57b998c4f19e22d413c4536b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 20 Nov 2013 18:26:23 -0800 Subject: [PATCH] CRM-13807 - Verify BAO exists in api getBAO --- api/v3/utils.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } /** -- 2.25.1