Merge pull request #8995 from kenjis/fix-command-loads-rewrite.php

fix: `command()` may execute `rewrite.php`
This commit is contained in:
kenjis 2024-06-25 10:00:37 +09:00 committed by GitHub
commit dd399029f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -103,7 +103,7 @@ class Serve extends BaseCommand
$docroot = escapeshellarg(FCPATH); $docroot = escapeshellarg(FCPATH);
// Mimic Apache's mod_rewrite functionality with user settings. // Mimic Apache's mod_rewrite functionality with user settings.
$rewrite = escapeshellarg(__DIR__ . '/rewrite.php'); $rewrite = escapeshellarg(SYSTEMPATH . 'rewrite.php');
// Call PHP's built-in webserver, making sure to set our // Call PHP's built-in webserver, making sure to set our
// base path to the public folder, and to use the rewrite file // base path to the public folder, and to use the rewrite file

View File

@ -21,11 +21,6 @@ declare(strict_types=1);
*/ */
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
// Avoid this file run when listing commands
if (PHP_SAPI === 'cli') {
return;
}
$uri = urldecode( $uri = urldecode(
parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '' parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? ''
); );