mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
some css changes
This commit is contained in:
@@ -6,20 +6,41 @@
|
||||
* Admin panel and static files are served directly.
|
||||
*/
|
||||
|
||||
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
$uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
|
||||
|
||||
// Static assets: let the dev server handle them directly
|
||||
$ext = pathinfo($uri, PATHINFO_EXTENSION);
|
||||
if (in_array($ext, ['css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg', 'woff', 'woff2', 'ttf', 'eot', 'map'], true)) {
|
||||
if (
|
||||
in_array(
|
||||
$ext,
|
||||
[
|
||||
"css",
|
||||
"js",
|
||||
"png",
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"gif",
|
||||
"ico",
|
||||
"svg",
|
||||
"woff",
|
||||
"woff2",
|
||||
"ttf",
|
||||
"eot",
|
||||
"otf",
|
||||
"map",
|
||||
],
|
||||
true,
|
||||
)
|
||||
) {
|
||||
return false; // serve directly
|
||||
}
|
||||
|
||||
// Admin panel: serve files directly
|
||||
if (str_starts_with($uri, '/admin')) {
|
||||
if (str_starts_with($uri, "/admin")) {
|
||||
// Rewrite /admin → /admin/index.php
|
||||
$file = __DIR__ . '/public' . $uri;
|
||||
$file = __DIR__ . "/public" . $uri;
|
||||
if (is_dir($file)) {
|
||||
$file .= '/index.php';
|
||||
$file .= "/index.php";
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
include $file;
|
||||
@@ -28,6 +49,6 @@ if (str_starts_with($uri, '/admin')) {
|
||||
}
|
||||
|
||||
// Send everything else through the front controller
|
||||
$_SERVER['SCRIPT_NAME'] = '/index.php';
|
||||
require __DIR__ . '/public/index.php';
|
||||
$_SERVER["SCRIPT_NAME"] = "/index.php";
|
||||
require __DIR__ . "/public/index.php";
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user