summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authorGergely Imreh <imrehg@gmail.com>2009-02-13 17:18:26 +0100
committerLoui Chang <louipc.ist@gmail.com>2009-02-15 21:12:28 +0100
commitefc171378761b5f18312fe904361be230143e237 (patch)
treeacc3e87715ec52dfda328bcd42e8edc64663d2bd /web/html/pkgsubmit.php
parent0caa949e4174ba2fcd144b29795ba98cb6f193af (diff)
downloadaur-efc171378761b5f18312fe904361be230143e237.tar.gz
aur-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/html/pkgsubmit.php')
-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 09f98e84..3913e697 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;