From 1af9b556b4782bf3dd489d9332602451f38cb8c0 Mon Sep 17 00:00:00 2001 From: yannicklm Date: Sat, 5 May 2012 19:43:55 +0200 Subject: [PATCH] improve error message for split package submission --- web/html/pkgsubmit.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 566890b..d92992f 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -249,7 +249,15 @@ if ($uid): $pkg_name = str_replace("'", "", $new_pkgbuild['pkgname']); $pkg_name = escapeshellarg($pkg_name); $pkg_name = str_replace("'", "", $pkg_name); + # If this was a split package, we will get spaces in the pkgname + # So kindly alert the user instead of the strange 'Invalid name' error + $splitted = explode(" ", $pkg_name); + if (count($splitted) > 1) { + $error = __("Uploading splitted packages to AUR is not allowed."); + } + } + if (!$error) { $presult = preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/", $pkg_name); if (!$presult) { -- 1.7.10.1