fix pargar bugs 2

This commit is contained in:
2026-07-21 13:25:18 +03:30
parent d43c5e1f25
commit 49e80a1b97
17 changed files with 228 additions and 106 deletions
+1 -16
View File
@@ -170,7 +170,7 @@ class File extends Model
{
try {
$rows = Setting::query()
->whereIn('key', ['bace_url', 'server_url', 'admin_url', 'app_url'])
->whereIn('key', ['bace_url', 'server_url'])
->where('is_active', 1)
->pluck('value', 'key');
@@ -180,21 +180,6 @@ class File extends Model
return rtrim($value, '/');
}
}
$adminUrl = trim((string) ($rows['admin_url'] ?? ''));
if ($adminUrl !== '' && preg_match('#/admin#i', $adminUrl)) {
return rtrim(preg_replace('#/admin/?$#i', '/server', rtrim($adminUrl, '/')), '/');
}
$siteUrl = trim((string) ($rows['app_url'] ?? ''));
if ($siteUrl !== '') {
$siteUrl = rtrim($siteUrl, '/');
if (! preg_match('#/server$#i', $siteUrl)) {
$siteUrl .= '/server';
}
return $siteUrl;
}
} catch (\Throwable) {
}