Skip to content

Commit

Permalink
Canonicalize urls before looking them up
Browse files Browse the repository at this point in the history
The method ProjectNode::findDocumentEntry() expects canonicalized urls,
and we fed it URLs that might be relative, leading to links not being
resolved.

Fixes phpDocumentor#486
  • Loading branch information
greg0ire committed Jul 11, 2023
1 parent 0dd4015 commit 013559b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public function resolve(LinkInlineNode $node, RenderContext $renderContext): boo
return false;
}

$document = $renderContext->getProjectNode()->findDocumentEntry($node->getTargetReference());
$document = $renderContext->getProjectNode()->findDocumentEntry(
$renderContext->canonicalUrl($node->getTargetReference()),
);
if ($document === null) {
return false;
}
Expand Down

0 comments on commit 013559b

Please sign in to comment.