From efc171378761b5f18312fe904361be230143e237 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Sat, 14 Feb 2009 00:18:26 +0800 Subject: 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 --- web/html/pkgsubmit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web/html') 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; -- cgit v1.2.3-24-g4f1b