summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2012-09-18 16:09:09 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2012-09-18 16:09:30 +0200
commit3b1dad229b6b486efc31c72090a8985773c329bb (patch)
treed130422b5ca826a23aa61bd02976d2ace45331b6
parentc959d95fb1b247aa9fc9a76e891a8a91f728b57d (diff)
downloadaur-3b1dad229b6b486efc31c72090a8985773c329bb.tar.gz
aur-3b1dad229b6b486efc31c72090a8985773c329bb.tar.xz
Fix category selection
Add a package ID parameter to pkg_change_category() instead of relying on the "ID" or "N" GET parameters. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/html/packages.php2
-rw-r--r--web/lib/pkgfuncs.inc.php10
2 files changed, 2 insertions, 10 deletions
diff --git a/web/html/packages.php b/web/html/packages.php
index 44f76719..3478ab97 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -89,7 +89,7 @@ if (check_token()) {
} elseif (current_action("do_DeleteComment")) {
$output = pkg_delete_comment($atype);
} elseif (current_action("do_ChangeCategory")) {
- $output = pkg_change_category($atype);
+ $output = pkg_change_category($pkgid, $atype);
}
}
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 593ccdea..b42df4c9 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -1206,7 +1206,7 @@ function pkg_delete_comment($atype, $dbh=NULL) {
* @param string $atype Account type, output of account_from_sid
* @return string Translated error or success message
*/
-function pkg_change_category($atype, $dbh=NULL) {
+function pkg_change_category($pid, $atype, $dbh=NULL) {
if (!$atype) {
return __("You must be logged in before you can edit package information.");
}
@@ -1226,14 +1226,6 @@ function pkg_change_category($atype, $dbh=NULL) {
return __("Invalid category ID.");
}
- if (isset($_GET["ID"])) {
- $pid = $_GET["ID"];
- } elseif (isset($_GET["N"])) {
- $pid = pkgid_from_name($_GET["N"]);
- } else {
- return __("Missing package ID.");
- }
-
# Verify package ownership
$q = "SELECT Packages.MaintainerUID ";
$q.= "FROM Packages ";