Skip to content

Commit 6f836c5

Browse files
committed
replace enable_shutdown_msg with enable_error_to_user
1 parent 95fbc8c commit 6f836c5

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

defaults/config.ini.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ terms_of_service_url = "https://github.com" ; this can be external or a portal p
1515
account_policy_url = "https://github.com" ; this can be external or a portal page created with "content management"
1616
allow_die = true ; internal use only
1717
enable_verbose_error_log = true ; internal use only
18-
enable_shutdown_msg = true ; internal use only
18+
enable_error_to_user = true ; internal use only
1919

2020
[ldap]
2121
uri = "ldap://identity" ; URI of remote LDAP server

deployment/overrides/phpunit/config/config.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ custom_user_mappings_dir = "test/custom_user_mappings"
55
allow_die = false
66
enable_verbose_error_log = false
77
enable_shutdown_message = false
8+
enable_error_to_user = false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[site]
2-
enable_shutdown_msg = false
2+
enable_error_to_user = false

resources/lib/UnitySite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ private static function errorToUser(
4747
int $http_response_code,
4848
string|null $errorid = null
4949
) {
50+
if (CONFIG["site"]["enable_error_to_user"] == false) {
51+
return;
52+
}
5053
// TODO uncomment after upgrade to php 8.4
5154
// http_clear_last_response_headers();
5255
if (!headers_sent()) {
@@ -119,9 +122,6 @@ public static function internalServerError($message, $error = null, $data = null
119122
// https://www.php.net/manual/en/function.register-shutdown-function.php
120123
public static function shutdown()
121124
{
122-
if (CONFIG["site"]["enable_shutdown_msg"] == false) {
123-
return;
124-
}
125125
$e = error_get_last();
126126
if (is_null($e) || $e["type"] !== E_ERROR) {
127127
return;

0 commit comments

Comments
 (0)