diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/html/pkgsubmit.php | 2 | ||||
-rw-r--r-- | web/lib/aur.inc.php | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 180a0b24..7b7023b9 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -135,7 +135,7 @@ if ($uid): $pkginfo = array(); $section_info = array(); foreach (explode("\n", $srcinfo_raw) as $line) { - $line = trim($line); + $line = ltrim($line); if (empty($line) || $line[0] == '#') { continue; } diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index b41b720c..ff464558 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -577,9 +577,12 @@ function latest_pkgs($numpkgs) { * Merge pkgbase and package options * * Merges entries of the first and the second array. If any key appears in both - * arrays and the corresponding value is an array itself, the arrays are - * merged. If a key appears in both arrays and the corresponding value is not - * an array, the second value replaces the first one. + * arrays and the corresponding value in the second array is either a non-array + * type or a non-empty array, the value from the second array replaces the + * value from the first array. If the value from the second array is an array + * containing a single empty string, the value in the resulting array becomes + * an empty array instead. If the value in the second array is empty, the + * resulting array contains the value from the first array. * * @param array $pkgbase_info Options from the pkgbase section * @param array $section_info Options from the package section @@ -590,7 +593,11 @@ function array_pkgbuild_merge($pkgbase_info, $section_info) { $pi = $pkgbase_info; foreach ($section_info as $opt_key => $opt_val) { if (is_array($opt_val)) { - $pi[$opt_key] += $opt_val; + if ($opt_val == array('')) { + $pi[$opt_key] = array(); + } elseif (count($opt_val) > 0) { + $pi[$opt_key] = $opt_val; + } } else { $pi[$opt_key] = $opt_val; } |