[fix] Multisite issue when using find function

When running multisite with subfolder, the route includes the subfolder. The `find` function returns `null` since it only needs the page route, without the subfolder.

This commit removes that subfolder as `$this->base`, which fixes the route on multisite with subfolder.

This has been tested on multisite with Grav v1.7.30 and Flex Objects
This commit is contained in:
Ryan Boog 2022-03-10 11:10:36 -06:00 committed by GitHub
parent 4d4efb31e3
commit 95817c28d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -957,6 +957,7 @@ class Pages
public function find($route, $all = false)
{
$route = urldecode((string)$route);
$route = str_replace($this->base, '', $route);
// Fetch page if there's a defined route to it.
$path = $this->routes[$route] ?? null;