Commit c318a504 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

pkg_comments.php: Fix "Latest Comments" link



Avoid adding "?comments=all" more than once if the "Latest Comments"
link is clicked multiple times.
Reported-by: default avatarcanyonknight <canyonknight@gmail.com>
Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 2e552cbc
......@@ -5,7 +5,7 @@ $pkgname = $row['Name'];
?>
<div id="news">
<h3>
<a href="<?php echo htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES) ?>?comments=all" title="<?php echo __('View all %s comments' , $count) ?>"><?php echo __('Latest Comments') ?></a>
<a href="<?php echo htmlentities(get_pkg_uri($pkgname), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?php echo __('View all %s comments' , $count) ?>"><?php echo __('Latest Comments') ?></a>
<span class="arrow"></span>
</h3>
......@@ -38,7 +38,7 @@ $pkgname = $row['Name'];
<?php if ($count > 10 && !isset($_GET['comments'])): ?>
<div id="news">
<h3>
<a href="<?php echo $_SERVER['REQUEST_URI'] ?>&amp;comments=all" title="<?php echo __('View all %s comments', $count) ?>"><?php echo __('All comments', $count) ?></a>
<a href="<?php echo htmlentities(get_pkg_uri($pkgname), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?php echo __('View all %s comments', $count) ?>"><?php echo __('All comments', $count) ?></a>
</h3>
</div>
<?php endif; ?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment