Skip to content

Commit

Permalink
DD-1513 : compare as well with base url
Browse files Browse the repository at this point in the history
  • Loading branch information
guardiola86 committed Sep 25, 2019
1 parent b60ba44 commit 4766956
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Dennis/Link/Checker/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,17 @@ public function redirectsToTerm() {
* @return bool
*/
public function redirectsToFront() {
$parsed_url = parse_url($this->originalHref());
$baseurl = $parsed_url['scheme'] . '://' . $parsed_url['host'] . '/';

if ($this->data['redirects_to_home']) {
return $this->data['redirects_to_home'];
}

$this->data['redirects_to_home'] = FALSE;

if ($this->correctedHref() != $this->originalHref()) {
if($this->correctedHref() == '/') {
if (in_array($this->correctedHref(), array('/', $baseurl))) {
$this->data['redirects_to_home'] = TRUE;
}
}
Expand Down

0 comments on commit 4766956

Please sign in to comment.