mirror of
https://github.com/getgrav/grav.git
synced 2026-09-05 23:39:22 +02:00
Fix for find() processing redirects via dispatch() - #781
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
* Fix for a remote link breaking all CSS rewrites for pipeline
|
||||
* Fix an issue with Retina alternatives not clearing properly between repeat uses
|
||||
* Fix for non standard http/s external markdown links - [#738](https://github.com/getgrav/grav/issues/738)
|
||||
* Fix for `find()` calling redirects via `dispatch()` causing infinite loops - [#781](https://github.com/getgrav/grav/issues/781)
|
||||
|
||||
# v1.0.10
|
||||
## 02/11/2016
|
||||
|
||||
@@ -297,18 +297,20 @@ class Pages
|
||||
*/
|
||||
public function find($url, $all = false)
|
||||
{
|
||||
return $this->dispatch($url, $all);
|
||||
return $this->dispatch($url, $all, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch URI to a page.
|
||||
*
|
||||
* @param string $url The relative URL of the page
|
||||
* @param bool $all
|
||||
* @param bool $all
|
||||
*
|
||||
* @param bool $redirect
|
||||
* @return Page|null
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dispatch($url, $all = false)
|
||||
public function dispatch($url, $all = false, $redirect = true)
|
||||
{
|
||||
// Fetch page if there's a defined route to it.
|
||||
$page = isset($this->routes[$url]) ? $this->get($this->routes[$url]) : null;
|
||||
@@ -324,7 +326,7 @@ class Pages
|
||||
if (!$all && $not_admin && (!$page || ($page && !$page->routable()) || ($page && $page->redirect()))) {
|
||||
|
||||
// If the page is a simple redirect, just do it.
|
||||
if ($page && $page->redirect()) {
|
||||
if ($redirect && $page && $page->redirect()) {
|
||||
$this->grav->redirectLangSafe($page->redirect());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user