pkg_comments.php: Fix comment deletion links

* Add a missing quote to the "alt" attribute. Regression introduced in
  d8b2eb4b62.

* Retrieve and store the package name before overwriting the "$row"
  variable.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-07-18 07:31:57 +02:00
parent bd4a7aa0ff
commit 9de84d2fd5

View file

@ -1,6 +1,7 @@
<?php <?php
$uid = uid_from_sid($SID); $uid = uid_from_sid($SID);
$count = package_comments_count($row['ID']); $count = package_comments_count($row['ID']);
$pkgname = $row['Name'];
?> ?>
<div id="news"> <div id="news">
<h3> <h3>
@ -14,12 +15,12 @@ $count = package_comments_count($row['ID']);
endif; ?> endif; ?>
<h4> <h4>
<?php if (canDeleteCommentArray($row, $atype, $uid)): ?> <?php if (canDeleteCommentArray($row, $atype, $uid)): ?>
<form method="post" action="<?php echo htmlspecialchars(get_pkg_uri($row['Name']), ENT_QUOTES); ?>"> <form method="post" action="<?php echo htmlspecialchars(get_pkg_uri($pkgname), ENT_QUOTES); ?>">
<fieldset style="display:inline;"> <fieldset style="display:inline;">
<input type="hidden" name="action" value="do_DeleteComment" /> <input type="hidden" name="action" value="do_DeleteComment" />
<input type="hidden" name="comment_id" value="<?php echo $row['ID'] ?>" /> <input type="hidden" name="comment_id" value="<?php echo $row['ID'] ?>" />
<input type="hidden" name="token" value="<?php echo htmlspecialchars($_COOKIE['AURSID']) ?>" /> <input type="hidden" name="token" value="<?php echo htmlspecialchars($_COOKIE['AURSID']) ?>" />
<input type="image" src="/images/x.png" alt="<?php echo __('Delete comment') ?> name="submit" value="1" /> <input type="image" src="/images/x.png" alt="<?php echo __('Delete comment') ?>" name="submit" value="1" />
</fieldset> </fieldset>
</form> </form>
<?php endif; ?> <?php endif; ?>