#164 fix comment update

This commit is contained in:
isUnknown 2025-09-23 08:20:17 +02:00
parent 13ac9eb6bb
commit 2e0f28a13f
48 changed files with 3732 additions and 428 deletions

View file

@ -5,11 +5,17 @@
$uri = parse_url('https://getkirby.com/' . ltrim($_SERVER['REQUEST_URI'], '/'), PHP_URL_PATH) ?? '/';
$uri = urldecode($uri);
// Emulate Apache's `mod_rewrite` functionality
if ($uri !== '/' && file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . ltrim($uri, '/'))) {
// emulate Apache's `mod_rewrite` functionality, but prevent
// disclosure of the existence of files outside the document root
$path = $_SERVER['DOCUMENT_ROOT'] . '/' . ltrim($uri, '/');
if (
$uri !== '/' &&
file_exists($path) === true &&
substr(realpath($path), 0, strlen($_SERVER['DOCUMENT_ROOT'])) === $_SERVER['DOCUMENT_ROOT']
) {
return false;
}
$_SERVER['SCRIPT_NAME'] = '/index.php';
require $_SERVER['DOCUMENT_ROOT'] . '/' . $_SERVER['SCRIPT_NAME'];
require $_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'];