summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-01-11 13:31:21 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2014-01-11 13:36:10 +0100
commitf2e26ebbf8daf847e091646814ffc6ae23989bc4 (patch)
treed9fd2e536596f24ce72de4638431a0b0fd216e4b /web/html
parentd8ea2d4a02a935a0e1c21605facfef5aa6b35acd (diff)
downloadaurweb-f2e26ebbf8daf847e091646814ffc6ae23989bc4.tar.xz
Fix split package error handling
Do not remove parentheses from the pkgname to make sure the split package detection works properly. Also, fix a regression introduced in 4bb6e88 (pkgsubmit.php: Simplify package name validation, 2013-03-05) that resulted in the split package error message never showing up. Fixes FS#37496. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html')
-rw-r--r--web/html/pkgsubmit.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index d2fe512..a2ec6dd 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -180,10 +180,12 @@ if ($uid):
}
if (!empty($lparts)) {
- # this is a variable/value pair, strip out
- # array parens and any quoting, except in pkgdesc
- # for pkgdesc, only remove start/end pairs of " or '
- if ($lparts[0]=="pkgdesc") {
+ # this is a variable/value pair, strip
+ # out array parens and any quoting,
+ # except in pkgdesc for pkgname or
+ # pkgdesc, only remove start/end pairs
+ # of " or '
+ if ($lparts[0] == "pkgname" || $lparts[0] == "pkgdesc") {
if ($lparts[1]{0} == '"' &&
$lparts[1]{strlen($lparts[1])-1} == '"') {
$pkgbuild[$lparts[0]] = substr($lparts[1], 1, -1);
@@ -286,8 +288,7 @@ if ($uid):
$pkg_name = $new_pkgbuild['pkgname'];
if ($pkg_name[0] == '(') {
$error = __("Error - The AUR does not support split packages!");
- }
- if (!preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/", $pkg_name)) {
+ } elseif (!preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/", $pkg_name)) {
$error = __("Invalid name: only lowercase letters are allowed.");
}
}