fix: billing cleanup, PayPal guard, docs nav prefix, coupon dark theme, XML guide link

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/52e5015e-f5cf-42e2-bc32-b1c77193a13f

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-06 15:24:27 +00:00 committed by GitHub
parent a45d102845
commit 9944b59332
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 158 additions and 37 deletions

View file

@ -16,6 +16,7 @@ $nav_prefix = '';
$scriptName = $_SERVER['SCRIPT_NAME'] ?? '';
if (is_string($scriptName) && $scriptName !== '') {
if (preg_match('#/modules/billing/(.*)$#', $scriptName, $match)) {
// Panel-embedded or non-root deployment: depth relative to modules/billing/
$subPath = $match[1];
if ($subPath !== '') {
$depth = substr_count($subPath, '/');
@ -23,6 +24,17 @@ if (is_string($scriptName) && $scriptName !== '') {
$nav_prefix = str_repeat('../', $depth);
}
}
} else {
// Root deployment: compute prefix from the script's directory depth so that
// links such as index.php correctly resolve to /index.php even when the
// current page lives in a subdirectory like /docs/.
$dir = dirname($scriptName);
if ($dir !== '/' && $dir !== '' && $dir !== '.') {
$segments = array_filter(explode('/', $dir), static function ($s) { return $s !== ''; });
if (!empty($segments)) {
$nav_prefix = str_repeat('../', count($segments));
}
}
}
}
$nav_prefix = $nav_prefix ?: '';