summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/html/pkgsubmit.php27
1 files changed, 16 insertions, 11 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index fd51c7e..793f8ca 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -361,20 +361,25 @@ if ($uid):
# Update package depends
$depends = explode(" ", $new_pkgbuild['depends']);
- foreach ($depends as $dep) {
- $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep);
- $depcondition = str_replace($deppkgname, "", $dep);
+ if ($depends !== false) {
+ foreach ($depends as $dep) {
+ $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep);
+ $depcondition = str_replace($deppkgname, "", $dep);
- if ($deppkgname == "#") {
- break;
- }
+ if ($deppkgname == "") {
+ continue;
+ }
+ else if ($deppkgname == "#") {
+ break;
+ }
- $q = sprintf("INSERT INTO PackageDepends (PackageID, DepName, DepCondition) VALUES (%d, '%s', '%s')",
- $packageID,
- mysql_real_escape_string($deppkgname),
- mysql_real_escape_string($depcondition));
+ $q = sprintf("INSERT INTO PackageDepends (PackageID, DepName, DepCondition) VALUES (%d, '%s', '%s')",
+ $packageID,
+ mysql_real_escape_string($deppkgname),
+ mysql_real_escape_string($depcondition));
- db_query($q, $dbh);
+ db_query($q, $dbh);
+ }
}
# Insert sources