From: eileen Date: Sun, 21 Mar 2021 23:19:47 +0000 (+1300) Subject: Fix loop X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ca5b3d1480ece90b25513f3e63962f5489145bd6;p=civicrm-core.git Fix loop It turns out that if you 'break' advanced search (in my case I applied a patch that caused invalid sql) it enters a loop. I really can't see why 'while' would have ever made sense here. There is nothing to cause it to 'move along' --- diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 0d15f3006e..6c44df6261 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -829,7 +829,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { // Exception backtrace if ($e instanceof PEAR_Exception) { $ei = $e; - while (is_callable([$ei, 'getCause'])) { + if (is_callable([$ei, 'getCause'])) { // DB_ERROR doesn't have a getCause but does have a __call function which tricks is_callable. if (!$ei instanceof DB_Error) { if ($ei->getCause() instanceof PEAR_Error) {