summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php28
1 files changed, 18 insertions, 10 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index e3495918..638654bc 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -421,11 +421,15 @@ if ($_COOKIE["AURSID"]) {
db_query($q, $dbh);
}
- $sources = explode(" ", $new_pkgbuild['source']);
- while (list($k, $v) = each($sources)) {
- $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
- $q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')";
- db_query($q, $dbh);
+ # Insert sources, if they don't exist don't inser them
+ #
+ if ($new_pkgbuild['source'] != "") {
+ $sources = explode(" ", $new_pkgbuild['source']);
+ while (list($k, $v) = each($sources)) {
+ $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
+ $q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')";
+ db_query($q, $dbh);
+ }
}
} else {
# this is a brand new package
@@ -483,11 +487,15 @@ if ($_COOKIE["AURSID"]) {
db_query($q, $dbh);
}
- $sources = explode(" ", $new_pkgbuild['source']);
- while (list($k, $v) = each($sources)) {
- $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
- $q .= $packageID.", '".mysql_real_escape_string($v)."')";
- db_query($q, $dbh);
+ # insert sources
+ #
+ if ($new_pkgbuild['source'] != "") {
+ $sources = explode(" ", $new_pkgbuild['source']);
+ while (list($k, $v) = each($sources)) {
+ $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
+ $q .= $packageID.", '".mysql_real_escape_string($v)."')";
+ db_query($q, $dbh);
+ }
}
}
}