Skip to content

Sync safe fixes from upstream laravel/valet - #2

Merged
Sandersm90 merged 1 commit into
masterfrom
sync/upstream-safe-fixes
Oct 1, 2026
Merged

Sandersm90 merged 1 commit into
masterfrom
sync/upstream-safe-fixes

Conversation

@Sandersm90

Copy link
Copy Markdown

Ports low-risk, platform-agnostic fixes from laravel/valet v4.12.0.

  • server.php: unset() Valet internals ($valetConfig, $valetSitePath, …) before including the front controller, so they no longer leak into the user application's global scope.
  • server.php / Server.php: use require instead of require_once for the front controller and the 404 template (meant to run every request).
  • ValetDriver: load .valet-env.php with include instead of include_once (a second call otherwise returns int(1) instead of the variables array).
  • CraftValetDriver: unset($_SERVER['argv']) in frontControllerPath() so Craft doesn't mis-detect console mode under the web SAPI.

Full suite green (224 tests at the time of this branch).

Port low-risk, platform-agnostic fixes from laravel/valet v4.12.0:

- server.php: unset Valet internals ($valetConfig, $valetSitePath, etc.)
  before including the front controller, so they no longer leak into the
  user application's global scope.
- server.php / Server.php: use require instead of require_once for the
  front controller and the 404 template, which are meant to run every request.
- ValetDriver: load .valet-env.php with include instead of include_once,
  so a second call returns the variables array rather than int(1).
- CraftValetDriver: unset $_SERVER['argv'] in frontControllerPath() so Craft
  does not mis-detect console mode under the web SAPI.
@Sandersm90 Sandersm90 closed this Oct 1, 2026
@Sandersm90 Sandersm90 reopened this Oct 1, 2026
@Sandersm90
Sandersm90 merged commit 0ab35bb into master Oct 1, 2026
5 checks passed
@Sandersm90
Sandersm90 deleted the sync/upstream-safe-fixes branch October 1, 2026 12:53
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