[aur-dev] [PATCH 4/4] pkg_comments.php: Fix "Latest Comments" link

Lukas Fleischer archlinux at cryptocrack.de
Tue Sep 18 08:24:34 EDT 2012


Avoid adding "?comments=all" more than once if the "Latest Comments"
link is clicked multiple times.

Reported-by: canyonknight <canyonknight at gmail.com>
Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/template/pkg_comments.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index d0bd4f8..b0aada2 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -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'] ?>&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; ?>
-- 
1.7.12



More information about the aur-dev mailing list