summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorGergely Imreh <imrehg@gmail.com>2009-05-30 08:35:08 +0200
committerLoui Chang <louipc.ist@gmail.com>2009-06-18 07:54:44 +0200
commit0427eebaa4b3343fa0d165fbfef2ff0857897b57 (patch)
tree8cb5c9c79a1fd7d42d4fa1f1cd7f5486824557b3 /web/html
parent51c62f2dc118d34569d7cc4d82f7179a01db5a45 (diff)
downloadaur-0427eebaa4b3343fa0d165fbfef2ff0857897b57.tar.gz
aur-0427eebaa4b3343fa0d165fbfef2ff0857897b57.tar.xz
fix FS#13122 (again): removing comment removal as early as possible
comments need to be removed before concatenating lines, otherwise not matched brackets can cause problems on submit Signed-off-by: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Loui Chang <louipc.ist@gmail.com>
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 383a7697..b2c7c0eb 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -77,6 +77,9 @@ if ($_COOKIE["AURSID"]):
$paren_depth = 0;
while (!feof($fp)) {
$line = trim(fgets($fp));
+ # Remove comments
+ $line = preg_replace('/\s*#.*/', '', $line);
+
$char_counts = count_chars($line, 0);
$paren_depth += $char_counts[ord('(')] - $char_counts[ord(')')];
if (substr($line, strlen($line)-1) == "\\") {
@@ -119,9 +122,6 @@ if ($_COOKIE["AURSID"]):
# Neutralize parameter substitution
$line = preg_replace('/\${(\w+)#(\w*)}?/', '$1$2', $line);
- # Remove comments
- $line = preg_replace('/\s*#.*/', '', $line);
-
$lparts = Array();
# Match variable assignment only.
if (preg_match('/^\s*[_\w]+=[^=].*/', $line, $matches)) {