From 2baf21cf050eddc72e7ae44de55fcae8934d2932 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 25 Mar 2014 22:54:42 -0700 Subject: [PATCH] civicrm_api3_create_error - Correction for weird SQL error reporting --- api/v3/utils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index 6084777033..fee1dffae7 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -153,7 +153,9 @@ function civicrm_api3_create_error($msg, $data = array(), &$dao = NULL) { // we will show sql to privelledged user only (not sure of a specific // security hole here but seems sensible - perhaps should apply to the trace as well? if(isset($data['sql']) && CRM_Core_Permission::check('Administer CiviCRM')) { - $data['debug_information'] = $data['sql']; + $data['debug_information'] = $data['sql']; // Isn't this redundant? + } else { + unset($data['sql']); } if (is_array($dao) && isset($dao['params']) && is_array($dao['params']) && !empty($dao['params']['api.has_parent'])) { $errorCode = empty($data['error_code']) ? 'chained_api_failed' : $data['error_code']; -- 2.25.1