Merge pull request #144 from creative-commoners/pulls/2.0/fix-canonical-redirects

FIX Ensure first processed stable version is treated as canonical
This commit is contained in:
Dylan Wagstaff 2017-11-13 14:08:23 +13:00 committed by GitHub
commit fccde14751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -459,7 +459,12 @@ class DocumentationManifest
{
$fromLink = $this->stripLinkBase($from);
$toLink = $this->stripLinkBase($to);
$this->redirects[$fromLink] = $toLink;
// If the redirect "from" is already registered with a "to", don't override it. This ensures
// that the first version processed is treated as the canonical version.
if (!isset($this->redirects[$fromLink])) {
$this->redirects[$fromLink] = $toLink;
}
}
/**