Commit e02aac67 authored by Sean Madsen's avatar Sean Madsen

Merge branch '83-redirect-loop' into 'master'

Fix infinite redirect loop

Closes #83

See merge request documentation/docs-publisher!83
parents f2781413 39ddc47b
......@@ -92,9 +92,6 @@ class Version {
$redirects = array($redirects);
// Remove alias for $path if it exists
// Add alias for $branch (e.g. so urls with "master" will work correctly)
$redirects[] = $this->branch;
......@@ -106,8 +103,11 @@ class Version {
$redirect = StringTools::urlSafe($redirect);
// Make sure we don't have any duplicate branches
// Make sure we don't have any duplicate redirects
$this->redirects = array_unique($redirects);
// Ensure that $path is not a redirect (to avoid infinite redirect loops)
$this->redirects = array_diff($this->redirects, [$this->path]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment