Skip to content

Commit 7ca318f

Browse files
committed
Use getURI instead in place of document URIs
1 parent 0c8bc42 commit 7ca318f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/templates/Document/Index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require("./header.inc.phtml");
4141
}
4242
?>
4343
<tr>
44-
<td><a href="<?php echo Common::relativeUrlToAbsolute("/document/" . urlencode($document->getId()) . "/" . Common::sanitizeForUrl($document->getTitle(), true)); ?>"><?php echo htmlspecialchars($document->getTitle(), ENT_HTML5, "UTF-8"); ?></a></td>
44+
<td><a href="<?php echo $document->getURI(); ?>"><?php echo htmlspecialchars($document->getTitle(), ENT_HTML5, "UTF-8"); ?></a></td>
4545
<td><?php if ($user) { ?><a href="<?php echo $user_url; ?>"><img class="avatar" src="<?php echo $avatar_url; ?>"/> <?php echo htmlspecialchars($user->getName(), ENT_HTML5, "UTF-8"); ?></a><?php } else { ?>Anonymous<?php } ?></td>
4646
</tr>
4747
<?php } ?>

src/templates/Document/View.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ $this->opengraph->attach(new Pair("type", "article"));
1818
$url = Common::relativeUrlToAbsolute("/document/" . urlencode($object_id));
1919
if ($object) {
2020

21-
$url .= "/" . Common::sanitizeForUrl($object->getTitle(), true);
22-
$this->opengraph->attach(new Pair("url", "/document/" . urlencode($object_id)
23-
. "/" . Common::sanitizeForUrl($object->getTitle(), true)));
21+
$url = $object->getURI();
22+
$this->opengraph->attach(new Pair("url", $url));
2423

2524
$title = htmlspecialchars($object->getTitle(), ENT_HTML5, "UTF-8");
2625
$description = Common::stripUpTo(trim(filter_var(

src/templates/User/View.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ require("./header.inc.phtml");
9292
<section>
9393
<ul>
9494
<?php foreach ($this->getContext()->documents as $document) { ?>
95-
<li><a href="<?php echo Common::relativeUrlToAbsolute("/document/" . urlencode($document->getId()) . "/" . Common::sanitizeForUrl($document->getTitle(), true)); ?>"><?php echo htmlspecialchars($document->getTitle()); ?></a></li>
95+
<li><a href="<?php echo $document->getURI(); ?>"><?php echo htmlspecialchars($document->getTitle()); ?></a></li>
9696
<?php } ?>
9797
</ul>
9898
</section>

0 commit comments

Comments
 (0)