[aur-dev] [PATCH 1/5] routing.inc.php: Add missing "/account" route
Minor oversight when adding the routing back end in commit eb22bcc7548d1b1025a3832aa4555792729d11b0. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/routing.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php index bbcb9e2..5cffe81 100644 --- a/web/lib/routing.inc.php +++ b/web/lib/routing.inc.php @@ -5,6 +5,7 @@ $ROUTES = array( '/index.php' => 'home.php', '/packages' => 'packages.php', '/register' => 'account.php', + '/account' => 'account.php', '/accounts' => 'account.php', '/login' => 'login.php', '/logout' => 'logout.php', -- 1.7.11.2
Make sure that pkg_change_category() works, even if the "N" is used and the "ID" get parameter is unset. Note that this is considered to be a hack rather than a proper fix; pkg_change_category() needs a lot of work. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/pkgfuncs.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 1351e72..6fad628 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -1212,6 +1212,8 @@ function pkg_change_category($atype, $dbh=NULL) { if (isset($_GET["ID"])) { $pid = $_GET["ID"]; + } elseif (isset($_GET["N"])) { + $pid = pkgid_from_name($_GET["N"]); } else { return __("Missing package ID."); } -- 1.7.11.2
Regression introduced in 2425f963f8ad45292c217914b5fee1ed18104c26. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/pkg_comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 30ceea5..0f7d80c 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -10,7 +10,7 @@ $count = package_comments_count($row['ID']); <?php while (list($indx, $row) = each($comments)): ?> <?php if ($SID): - $row['UserName'] = "<a href=\"<?php echo get_uri('/account/'); ?>?Action=AccountInfo&ID={$row['UsersID']}\">{$row['UserName']}</a>"; + $row['UserName'] = "<a href=\"" . get_uri('/account/') . "?Action=AccountInfo&ID={$row['UsersID']}\">{$row['UserName']}</a>"; endif; ?> <h4> <?php if (canDeleteCommentArray($row, $atype, $uid)): ?> -- 1.7.11.2
* Add a missing quote to the "alt" attribute. Regression introduced in d8b2eb4b628e8927b0bed1b254c996520de95b83. * Retrieve and store the package name before overwriting the "$row" variable. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/pkg_comments.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 0f7d80c..46c1ef3 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -1,6 +1,7 @@ <?php $uid = uid_from_sid($SID); $count = package_comments_count($row['ID']); +$pkgname = $row['Name']; ?> <div id="news"> <h3> @@ -14,12 +15,12 @@ $count = package_comments_count($row['ID']); endif; ?> <h4> <?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;"> <input type="hidden" name="action" value="do_DeleteComment" /> <input type="hidden" name="comment_id" value="<?php echo $row['ID'] ?>" /> <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> </form> <?php endif; ?> -- 1.7.11.2
Use include_once() instead of include(). Otherwise, a fatal error is shown if the virtual path feature is used since "web/lib/aur.inc.php" is already included in the routing front end. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/html/voters.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/html/voters.php b/web/html/voters.php index 3ba5248..c7c59a2 100644 --- a/web/html/voters.php +++ b/web/html/voters.php @@ -1,7 +1,7 @@ <?php set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); -include('aur.inc.php'); -include('pkgfuncs.inc.php'); +include_once('aur.inc.php'); +include_once('pkgfuncs.inc.php'); $SID = $_COOKIE['AURSID']; -- 1.7.11.2
participants (1)
-
Lukas Fleischer