[aur-dev] [PATCH 2/3] Use POST-Redirect-GET for most package actions

Lukas Fleischer archlinux at cryptocrack.de
Tue Aug 27 05:37:47 EDT 2013


Avoid showing a POST data resubmission dialog and simply redirect to the
package page if a package action completed successfully.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/html/packages.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/web/html/packages.php b/web/html/packages.php
index 046a942..e03a099 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -98,6 +98,12 @@ if (check_token()) {
 	} elseif (current_action("do_ChangeCategory")) {
 		list($ret, $output) = pkg_change_category($pkgid, $atype);
 	}
+
+	if ($ret) {
+		/* Redirect back to package page on success. */
+		header('Location: ' . get_pkg_uri($pkgname));
+		exit();
+	}
 }
 
 # Get package details after package actions have been attempted, FS#34508
-- 
1.8.4.rc3.500.gc3113b0



More information about the aur-dev mailing list