From 35a17d69618dba86e62f27c88a23bce50935cd3b Mon Sep 17 00:00:00 2001 From: Clemente Raposo Date: Tue, 14 Jan 2025 12:06:37 +0000 Subject: [PATCH] [Legacy] Add disable_echos global on legacy --- public/legacy/include/utils.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/legacy/include/utils.php b/public/legacy/include/utils.php index c7f257f6c..c3971df6e 100755 --- a/public/legacy/include/utils.php +++ b/public/legacy/include/utils.php @@ -2122,7 +2122,10 @@ function sugar_die($error_message, $exit_code = 1) { global $focus; sugar_cleanup(); - echo $error_message; + + if (!empty($GLOBALS['disable_echos'])) { + echo $error_message; + } throw new Exception($error_message, $exit_code); } @@ -3760,10 +3763,12 @@ function sugar_cleanup($exit = false) //this is not an ajax call and the user preference error flag is set, so reset the flag and print js to flash message $err_mess = $app_strings['ERROR_USER_PREFS']; $_SESSION['USER_PREFRENCE_ERRORS'] = false; - echo " - "; + if (!empty($GLOBALS['disable_echos'])) { + echo " + "; + } } pre_login_check();