CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

Router throws `BadRequestException` for UNC paths in CLI commands

Open simomassimo opened this issue 8 months ago • 1 comments

PHP Version

8.4

CodeIgniter4 Version

latest

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

macOS, Windows

Which server did you use?

apache

Database

No response

What happened?

checkDisallowedChars() method should be protected or contain is_cli() handling since CLI functions might use disallowed characters e.g. hidden UNC paths are marked with $ sign.

Steps to Reproduce

Create a function wich takes UNC path as argument and use hidden windows share UNC path as argument e.g. \\SHARE\thisishidden$

Expected Output

When using cli commands it is not mandatory to enforce disallowed characters policy or at least checkDisallowedChars() should be marked as protected so it can be overridden without any need to tamper with CI system files.

Anything else?

No response

simomassimo avatar Apr 22 '25 14:04 simomassimo

Why would you need to pass a UNC path to a CLI command? This seems to be a misuse. If you could please provide further details so we can assess.

paulbalandan avatar Apr 27 '25 15:04 paulbalandan

No response received. Closing.

paulbalandan avatar Jun 28 '25 12:06 paulbalandan