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: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-09-18 13:36:34 +02:00
parent 2e552cbcad
commit c318a50435

View file

@ -5,7 +5,7 @@ $pkgname = $row['Name'];
?> ?>
<div id="news"> <div id="news">
<h3> <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> <span class="arrow"></span>
</h3> </h3>
@ -38,7 +38,7 @@ $pkgname = $row['Name'];
<?php if ($count > 10 && !isset($_GET['comments'])): ?> <?php if ($count > 10 && !isset($_GET['comments'])): ?>
<div id="news"> <div id="news">
<h3> <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> </h3>
</div> </div>
<?php endif; ?> <?php endif; ?>