Skip to content

Commit

Permalink
šŸ› Bootloader: Bail early on wp-login.php/wp-admin, and some otherā€¦
Browse files Browse the repository at this point in the history
ā€¦ `/wp-` requests (#339)

---------

Co-authored-by: Brandon <brandon@tendency.me>
  • Loading branch information
retlehs and Log1x committed Feb 1, 2024
1 parent f467dce commit 74671f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Roots/Acorn/Bootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,15 @@ protected function registerRequestHandler(
?\Illuminate\Routing\Route $route,
array $config
) {
if (Str::contains($request->getRequestUri(), [
'/wp-comments-post.php',
'/wp-login.php',
'/wp-signup.php',
'/wp-admin/',
])) {
return; // Let WordPress handle these requests
}

add_filter('do_parse_request', function ($doParse, \WP $wp, $extraQueryVars) use ($route) {
if (! $route) {
return $doParse;
Expand Down

0 comments on commit 74671f1

Please sign in to comment.