Publier Globinours 1.0.0-rc.3
This commit is contained in:
parent
ea8c24d622
commit
9a2b4068da
325 changed files with 38230 additions and 20 deletions
20
public/router.php
Normal file
20
public/router.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Routeur destiné uniquement au serveur PHP intégré pour les démonstrations.
|
||||
$requestPath = rawurldecode((string) (parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/'));
|
||||
$publicRoot = realpath(__DIR__);
|
||||
$requestedFile = realpath(__DIR__ . $requestPath);
|
||||
|
||||
if (
|
||||
$requestPath !== '/' &&
|
||||
$publicRoot !== false &&
|
||||
$requestedFile !== false &&
|
||||
str_starts_with($requestedFile, $publicRoot . DIRECTORY_SEPARATOR) &&
|
||||
is_file($requestedFile)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
require __DIR__ . '/index.php';
|
||||
Loading…
Add table
Add a link
Reference in a new issue