summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authorGergely Imreh <imrehg@gmail.com>2009-02-16 17:56:23 +0100
committerLoui Chang <louipc.ist@gmail.com>2009-02-16 17:56:23 +0100
commitf3a29356c51d2b1a56e0122f58385e7d36f9975a (patch)
treea1d8b0133c206dd242ee970e01493a993b882380 /web/html/pkgsubmit.php
parentefc171378761b5f18312fe904361be230143e237 (diff)
downloadaur-f3a29356c51d2b1a56e0122f58385e7d36f9975a.tar.gz
aur-f3a29356c51d2b1a56e0122f58385e7d36f9975a.tar.xz
Correct comment removal in pkgsubmit.php1.5.6.1
This only neutralises bash parameter substitution, but doesn't perform the proper replacement. Closes FS#13122. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 3913e697..4e106083 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -66,13 +66,12 @@ if ($_COOKIE["AURSID"]):
# TODO: This needs to be completely rewritten to support stuff like arrays
# and variable substitution among other things.
if (!$error) {
- # process PKGBIULD - remove line concatenation
+ # process PKGBUILD - remove line concatenation
#
$pkgbuild = array();
$fp = fopen($pkg_dir."/PKGBUILD", "r");
$line_no = 0;
$lines = array();
- $decomment = array();
$continuation_line = 0;
$current_line = "";
$paren_depth = 0;
@@ -89,8 +88,6 @@ 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 {
@@ -119,6 +116,12 @@ if ($_COOKIE["AURSID"]):
#
$seen_build_function = 0;
while (list($k, $line) = each($lines)) {
+ # Neutralize parameter substitution
+ $line = preg_replace('/\${(\w+)#(\w*)}?/', '$1$2', $line);
+
+ # Remove comments
+ $line = preg_replace('/#.*/', '', $line);
+
$lparts = explode("=", $line, 2);
if (count($lparts) == 2) {
# this is a variable/value pair, strip out