Skip to content

Commit dd39902

Browse files
authored
Merge pull request #8995 from kenjis/fix-command-loads-rewrite.php
fix: `command()` may execute `rewrite.php`
2 parents e0e8f83 + 9f6bf3f commit dd39902

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

system/Commands/Server/Serve.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function run(array $params)
103103
$docroot = escapeshellarg(FCPATH);
104104

105105
// Mimic Apache's mod_rewrite functionality with user settings.
106-
$rewrite = escapeshellarg(__DIR__ . '/rewrite.php');
106+
$rewrite = escapeshellarg(SYSTEMPATH . 'rewrite.php');
107107

108108
// Call PHP's built-in webserver, making sure to set our
109109
// base path to the public folder, and to use the rewrite file

system/Commands/Server/rewrite.php renamed to system/rewrite.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
*/
2222

2323
// @codeCoverageIgnoreStart
24-
// Avoid this file run when listing commands
25-
if (PHP_SAPI === 'cli') {
26-
return;
27-
}
28-
2924
$uri = urldecode(
3025
parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? ''
3126
);

0 commit comments

Comments
 (0)