summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorcanyonknight <canyonknight@gmail.com>2012-07-14 14:20:11 -0400
committerLukas Fleischer <archlinux@cryptocrack.de>2012-07-14 22:19:52 +0200
commit857de725d1c87da005b4ab8e9a88222fd19aab4b (patch)
treec4300feaf9eea1318276ddada8a975854c2c73c1 /web/html
parent1fd559151b201556ae8d2b71de8abc8641dbf953 (diff)
downloadaurweb-857de725d1c87da005b4ab8e9a88222fd19aab4b.tar.xz
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>
Diffstat (limited to 'web/html')
-rw-r--r--web/html/pkgsubmit.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index c2a7191..737812e 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);
}
}