Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Cleaning up the external URL behaviour when using a page redirect type.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 3, 2016
1 parent 0760e5b commit 94e5293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/dataobjects/LinkMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function getLink() {

// This is to support multiple sites, where the absolute page URLs are treated as relative.

return MisdirectionService::is_external_URL($link) ? HTTP::setGetVar('misdirected', true, ltrim($link, '/')) : $link;
return MisdirectionService::is_external_URL($link) ? ltrim($link, '/') : $link;
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions code/services/MisdirectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ public function getRecursiveMapping($map, $host = null, $testing = false) {
$host = $map->getLinkHost();
}

// Determine the next link mapping.
// Determine the next link mapping, immediately redirecting towards an external URL.

while(!self::is_external_URL($redirect) && ($next = $this->getMapping($redirect, $host))) {
while((($map->RedirectType === 'Page') || !self::is_external_URL($redirect)) && ($next = $this->getMapping($redirect, $host))) {

// Enforce a maximum number of redirects, preventing infinite recursion and inefficient link mappings.

Expand Down

0 comments on commit 94e5293

Please sign in to comment.