mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
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>
This commit is contained in:
parent
0caa949e41
commit
efc1713787
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue