From 238695c40294270afa5bd94061c9a4b960a880c3 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Mon, 1 Oct 2012 19:01:41 -0400 Subject: pkgsubmit.php: Fix PHP notice for depends processing A foreach() is run without verifying an uploaded package has any depends. Fix the undefined index notice for packages uploaded with no depends. Similar to commit 857de725d1c87da005b4ab8e9a88222fd19aab4b. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/html/pkgsubmit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 930add0..09e95ca 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -390,8 +390,8 @@ if ($uid): } # Update package depends - $depends = explode(" ", $new_pkgbuild['depends']); - if ($depends !== false) { + if (!empty($new_pkgbuild['depends'])) { + $depends = explode(" ", $new_pkgbuild['depends']); foreach ($depends as $dep) { $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep); $depcondition = str_replace($deppkgname, "", $dep); -- cgit v1.2.3-70-g09d2