From 857de725d1c87da005b4ab8e9a88222fd19aab4b Mon Sep 17 00:00:00 2001 From: canyonknight Date: Sat, 14 Jul 2012 14:20:11 -0400 Subject: 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 Signed-off-by: Lukas Fleischer --- web/html/pkgsubmit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index c2a71918..737812e1 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -379,9 +379,9 @@ if ($uid): } # Insert sources - $sources = explode(" ", $new_pkgbuild['source']); - foreach ($sources as $src) { - if ($src != "" ) { + if (!empty($new_pkgbuild['source'])) { + $sources = explode(" ", $new_pkgbuild['source']); + foreach ($sources as $src) { add_pkg_src($packageID, $src, $dbh); } } -- cgit v1.2.3-24-g4f1b