summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorGergely Imreh <imrehg@gmail.com>2009-02-14 00:18:26 +0800
committerLoui Chang <louipc.ist@gmail.com>2009-02-15 15:12:28 -0500
commitefc171378761b5f18312fe904361be230143e237 (patch)
treeacc3e87715ec52dfda328bcd42e8edc64663d2bd /web
parent0caa949e4174ba2fcd144b29795ba98cb6f193af (diff)
downloadaurweb-efc171378761b5f18312fe904361be230143e237.tar.xz
Fix: FS#13189, infinite variable replacement cycle
Lines such as foo=$foo in the PKGBUILD would end up in a infinite replacement cycle when uploaded, thus the upload times out. In these kind of lines, $foo is replaced not by "$foo" again, but deleted (missing value for foo). Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web')
-rw-r--r--web/html/pkgsubmit.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 09f98e8..3913e69 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -205,7 +205,11 @@ if ($_COOKIE["AURSID"]):
while (preg_match($pattern_var,$v,$regs)) {
$pieces = explode(" ",$pkgbuild["$regs[2]"],2);
$pattern = '/\$'.$regs[1].$regs[2].$regs[3].'/';
- $replacement = $pieces[0];
+ if ($regs[2] != $k) {
+ $replacement = $pieces[0];
+ } else {
+ $replacement = "";
+ }
$v=preg_replace($pattern, $replacement, $v);
}
$new_pkgbuild[$k] = $v;