From 2ecf93a3440103ec667f0f3bb0cdb563d1eb3289 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 22 Jun 2026 04:29:10 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20hardcode=20panel=20ports=20in=20CORS=20c?= =?UTF-8?q?heck=20=E2=80=94=20PORT=5FUSER=20etc=20undefined=20before=20Cor?= =?UTF-8?q?e.php=20loads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using PORT_USER ?? 8880 threw Error in PHP 8 since the constant isn't defined until Core.php is require_once'd later in the file. Every API request was hitting the exception handler and returning 'An internal error occurred.', breaking all logins and API calls. --- panel/api/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/api/index.php b/panel/api/index.php index e8bab83..d69599d 100644 --- a/panel/api/index.php +++ b/panel/api/index.php @@ -33,7 +33,7 @@ $_allowedHosts = ['novacpx.orbishosting.com', 'admin.novacpx.orbishosting.com', 'web.orbishosting.com']; $_originHost = parse_url($origin, PHP_URL_HOST) ?? ''; $_originPort = (int)(parse_url($origin, PHP_URL_PORT) ?? 0); -$_panelPorts = [PORT_USER ?? 8880, PORT_RESELLER ?? 8881, PORT_ADMIN ?? 8882, PORT_WEBMAIL ?? 8883]; +$_panelPorts = [8880, 8881, 8882, 8883]; // hardcoded — Core.php not loaded yet if ($origin && ( in_array($_originHost, $_allowedHosts, true) || (in_array($_originPort, $_panelPorts, true) && filter_var($_originHost, FILTER_VALIDATE_IP))