]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Fix issue with @ob_end_flush() still throwing an error
authorBram Matthys <redacted>
Wed, 26 Apr 2023 16:26:15 +0000 (18:26 +0200)
committerBram Matthys <redacted>
Wed, 26 Apr 2023 16:26:15 +0000 (18:26 +0200)
(yeah, it throws now instead of... well... PHP manual is outdated i guess)

api/common_api.php

index 7173977ff6b5da3a3f4b53778f4a6cf10ac798bf..04af80c631df56e10543e61da2ee54fdbf533973 100644 (file)
@@ -30,7 +30,17 @@ set_time_limit(0);
 ob_implicit_flush(1);
 
 // Flush and stop output buffering (eg fastcgi w/NGINX)
-while (@ob_end_flush());
+while (1)
+{
+       try {
+               $ret = @ob_end_flush();
+               if ($ret === false)
+                       break;
+       } catch(Exception $e)
+       {
+               break;
+       }
+};
 
 /* Send server-sent events (SSE) message */
 function send_sse($json)