summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorMarcel Korpel <marcel.korpel@gmail.com>2015-07-10 18:47:36 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-08-08 12:59:24 +0200
commit19aff5f9583b2450208cbd748c1e4b2ce27b3fe0 (patch)
treec8cdc1d51fa30b5e6ffdb721aed615a98d35332c /web/html
parent67cff2cd5ac67d16c7934d95391518836acd1a36 (diff)
downloadaur-19aff5f9583b2450208cbd748c1e4b2ce27b3fe0.tar.gz
aur-19aff5f9583b2450208cbd748c1e4b2ce27b3fe0.tar.xz
Jump to comment after editing
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/html')
-rw-r--r--web/html/pkgbase.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php
index 5886f714..65077b37 100644
--- a/web/html/pkgbase.php
+++ b/web/html/pkgbase.php
@@ -46,6 +46,7 @@ if (isset($_POST['IDs'])) {
/* Perform package base actions. */
$ret = false;
$output = "";
+$fragment = "";
if (check_token()) {
if (current_action("do_Flag")) {
list($ret, $output) = pkgbase_flag($ids);
@@ -110,6 +111,9 @@ if (check_token()) {
$ret = true;
} elseif (current_action("do_EditComment")) {
list($ret, $output) = pkgbase_edit_comment($_REQUEST['comment']);
+ if ($ret && isset($_POST["comment_id"])) {
+ $fragment = '#comment-' . intval($_POST["comment_id"]);
+ }
}
if ($ret) {
@@ -120,7 +124,7 @@ if (check_token()) {
exit();
} if (isset($base_id)) {
/* Redirect back to package base page on success. */
- header('Location: ' . get_pkgbase_uri($pkgbase_name));
+ header('Location: ' . get_pkgbase_uri($pkgbase_name) . $fragment);
exit();
} else {
/* Redirect back to package search page. */
@@ -134,9 +138,9 @@ $pkgs = pkgbase_get_pkgnames($base_id);
if (!$output && count($pkgs) == 1) {
/* Not a split package. Redirect to the package page. */
if (empty($_SERVER['QUERY_STRING'])) {
- header('Location: ' . get_pkg_uri($pkgs[0]));
+ header('Location: ' . get_pkg_uri($pkgs[0]) . $fragment);
} else {
- header('Location: ' . get_pkg_uri($pkgs[0]) . '?' . $_SERVER['QUERY_STRING']);
+ header('Location: ' . get_pkg_uri($pkgs[0]) . '?' . $_SERVER['QUERY_STRING'] . $fragment);
}
}