[PATCH] Ignore merge target for non-merge requests

Lukas Fleischer lfleischer at archlinux.org
Fri May 24 16:25:11 UTC 2019


Fixes FS#59837.

Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 web/lib/pkgreqfuncs.inc.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index 774ebe7..b8be7e5 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -127,6 +127,11 @@ function pkgreq_file($ids, $type, $merge_into, $comments) {
 		return array(false, __("You must be logged in to file package requests."));
 	}
 
+	/* Ignore merge target for non-merge requests. */
+	if ($type !== 'merge') {
+		$merge_into = '';
+	}
+
 	if (!empty($merge_into) && !preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/D", $merge_into)) {
 		return array(false, __("Invalid name: only lowercase letters are allowed."));
 	}
-- 
2.21.0


More information about the aur-dev mailing list