pkgsubmit.php: Refactor source processing to fix PHP notice

A foreach() being run without checking to see if the uploaded PKGBUILD had any
sources now no longer causes an undefined index notice when there are no
sources.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
canyonknight 2012-07-14 14:20:11 -04:00 committed by Lukas Fleischer
parent 1fd559151b
commit 857de725d1

View file

@ -379,9 +379,9 @@ if ($uid):
}
# Insert sources
if (!empty($new_pkgbuild['source'])) {
$sources = explode(" ", $new_pkgbuild['source']);
foreach ($sources as $src) {
if ($src != "" ) {
add_pkg_src($packageID, $src, $dbh);
}
}