@@ -53,18 +53,6 @@ public static function redirect(?string $dest = null): never
5353 self ::die ();
5454 }
5555
56- /*
57- generate a unique ID that can be logged and also displayed to the user when something has
58- gone wrong. This way the user can give us the ID and we can find the exact line in the log
59- file that represents their issue.
60- assumes that a session is started and has a good unique session_id
61- */
62- public static function errorID (?\Throwable $ e = null ): string
63- {
64- $ e ??= new stdClass ();
65- return md5 (strval (session_id ()) . spl_object_id ($ e ));
66- }
67-
6856 /*
6957 generates a unique error ID, writes to error log, and then:
7058 if "html_errors" is disabled in the PHP config file:
@@ -84,7 +72,7 @@ public static function gracefulDie(
8472 int $ http_response_code = 200 ,
8573 mixed $ data = null ,
8674 ): never {
87- $ errorid = self :: errorID ( $ error );
75+ $ errorid = uniqid ( );
8876 $ suffix = sprintf (
8977 "Please notify a Unity admin at %s. Error ID: %s. " ,
9078 CONFIG ["mail " ]["support " ],
@@ -148,9 +136,6 @@ public static function errorLog(
148136 $ output ["REMOTE_USER " ] = $ _SERVER ["REMOTE_USER " ] ?? null ;
149137 $ output ["REMOTE_ADDR " ] = $ _SERVER ["REMOTE_ADDR " ] ?? null ;
150138 $ output ["_REQUEST " ] = $ _REQUEST ;
151- if (is_null ($ errorid ) && !is_null ($ error )) {
152- $ errorid = self ::errorID ($ error );
153- }
154139 if (!is_null ($ errorid )) {
155140 $ output ["errorid " ] = $ errorid ;
156141 }
0 commit comments