summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authorGergely Imreh <imrehg@gmail.com>2009-01-11 04:33:34 +0100
committerLoui Chang <louipc.ist@gmail.com>2009-01-15 03:52:37 +0100
commit5b01327f5776861980ec3cd923462b5f79db3fa6 (patch)
tree3692e36eb36085457767645b2d7f7c1aba8d7a59 /web/html/pkgsubmit.php
parent2da9b55d9fb30f8da124dce4ed8d49af11bd5523 (diff)
downloadaur-5b01327f5776861980ec3cd923462b5f79db3fa6.tar.gz
aur-5b01327f5776861980ec3cd923462b5f79db3fa6.tar.xz
Fix: FS#12698 - AUR does not ignore comment lines in PKGBUILD source field.
The web interface was handling comments in the PKGBUILD variable fields (such as 'source','depends',etc...) differently from makepkg, because makepkg ignores the rest of the current line if there is a # character, while the web interface parsed that as well, and listed the words of the comment as source files. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index b4b94d23..91512532 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -73,6 +73,7 @@ if ($_COOKIE["AURSID"]):
$fp = fopen($pkg_dir."/PKGBUILD", "r");
$line_no = 0;
$lines = array();
+ $decomment = array();
$continuation_line = 0;
$current_line = "";
$paren_depth = 0;
@@ -89,6 +90,8 @@ if ($_COOKIE["AURSID"]):
# assumed continuation
# continue appending onto existing line_no
#
+ $decomment = explode("#",$line,2);
+ $line = $decomment[0];
$current_line .= $line . " ";
$continuation_line = 1;
} else {
@@ -331,9 +334,11 @@ if ($_COOKIE["AURSID"]):
# Insert sources
$sources = explode(" ", $new_pkgbuild['source']);
foreach ($sources as $src) {
- $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
- $q .= $pdata["ID"] . ", '" . mysql_real_escape_string($src) . "')";
- db_query($q, $dbh);
+ if ($src != "" ) {
+ $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
+ $q .= $pdata["ID"] . ", '" . mysql_real_escape_string($src) . "')";
+ db_query($q, $dbh);
+ }
}
header('Location: packages.php?ID=' . $pdata['ID']);
@@ -377,9 +382,11 @@ if ($_COOKIE["AURSID"]):
# Insert sources
$sources = explode(" ", $new_pkgbuild['source']);
foreach ($sources as $src) {
- $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
- $q .= $packageID . ", '" . mysql_real_escape_string($src) . "')";
- db_query($q, $dbh);
+ if ($src != "" ) {
+ $q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
+ $q .= $packageID . ", '" . mysql_real_escape_string($src) . "')";
+ db_query($q, $dbh);
+ }
}
header('Location: packages.php?ID=' . $packageID);