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();