forked from FWS/FWS-TEMPLATE-Website-OnePage
fix(admin): build admin URLs against the dynamic base URL
Preview thumbnails for package screenshots and the API test link assumed a root deployment; use fws_url() and derive the scheme from the request instead of hardcoding https.
This commit is contained in:
2 files changed
+4
-3
No files matched your search
@@ -792,7 +792,7 @@ table.list th { color: #94a3b8; font-size: .72rem; text-transform: uppercase; le
|
||||
<header class="top">
|
||||
<div>
|
||||
<h1>🐞 Signalements de bugs</h1>
|
||||
<div class="sub">Connecté : <?= h($user['name']) ?> · Base SQLite · <a href="../../api/bugs.php" target="_blank">tester l'API</a></div>
|
||||
<div class="sub">Connecté : <?= h($user['name']) ?> · Base SQLite · <a href="<?= h(fws_url('/api/bugs.php')) ?>" target="_blank">tester l'API</a></div>
|
||||
</div>
|
||||
<form class="inline" method="post">
|
||||
<input type="hidden" name="action" value="logout">
|
||||
@@ -1075,7 +1075,7 @@ table.list th { color: #94a3b8; font-size: .72rem; text-transform: uppercase; le
|
||||
<div class="pkg-screens-picker">
|
||||
<?php $remaining = FWS_PKG_IMG_MAX - count($formScreensData); foreach ($formScreensData as $fs): $src = (string) ($fs['src'] ?? ''); if ($src === '') continue; ?>
|
||||
<figure class="pkg-shot">
|
||||
<img src="<?= h($src) ?>" alt="">
|
||||
<img src="<?= h(function_exists('fws_url') ? fws_url($src) : $src) ?>" alt="">
|
||||
<label class="pkg-shot-keep"><input type="checkbox" name="keep_screens[]" value="<?= h($src) ?>" checked> garder</label>
|
||||
<input type="text" name="captions[<?= h($src) ?>]" value="<?= h((string) ($fs['caption'] ?? '')) ?>" placeholder="Légende (optionnelle)">
|
||||
</figure>
|
||||
|
||||
@@ -89,7 +89,8 @@ if ($ok) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseUrl = 'https://' . ($_SERVER['HTTP_HOST'] ?? 'fwslinux.fr');
|
||||
$fwsScheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$baseUrl = $fwsScheme . '://' . ($_SERVER['HTTP_HOST'] ?? 'fwslinux.fr');
|
||||
$codeValue = $submitted ? $code : '';
|
||||
$userValue = $submitted ? $username : '';
|
||||
?>
|
||||
|
||||
Reference in new issue
Block a user