Skip to content

Fix DevCommands vendor registration check skipping userland frames#60538

Open
joetannenbaum wants to merge 3 commits into
13.xfrom
artisan-dev-vendor-prevention
Open

Fix DevCommands vendor registration check skipping userland frames#60538
joetannenbaum wants to merge 3 commits into
13.xfrom
artisan-dev-vendor-prevention

Conversation

@joetannenbaum

Copy link
Copy Markdown
Contributor

The vendor prevention check was comparing $class === self::class to skip internal frames, but in PHP backtraces $frame["class"] is the class being called, not the caller. So when userland code (e.g. AppServiceProvider) calls DevCommands::register(), the frame has the userland file but DevCommands as the class, causing it to be skipped. This meant legitimate userland registrations could be incorrectly rejected.

Switches to $file === __FILE__ so we only skip frames that physically originate from DevCommands.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant