[aur-dev] [PATCH] Fix hashes in arrays
I've fixed the parsing of hashes in arrays, as they would have been treated as comments before. If a line with a hash in it is found, and it ends in `')` or `")`, it will not be treated as a comment. I've already submitted this patch as an attachment, but here it is again in the 'proper' form. Neer Sighted (1): pkgsubmit.php: Fix comment parsing in arrays web/html/pkgsubmit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.1.4
Fix the comment parsing in arrays, so that a hash in a one-line array does not get parsed as a comment. --- web/html/pkgsubmit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index fefb31e..dbc8a00 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -130,7 +130,7 @@ if ($uid): foreach (explode("\n", $pkgbuild_raw) as $line) { $line = trim($line); # Remove comments - $line = preg_replace('/\s*#.*/', '', $line); + $line = preg_replace('/\s*#.*(?:[^"'][^\)])$/', '', $line); $char_counts = count_chars($line, 0); $paren_depth += $char_counts[ord('(')] - $char_counts[ord(')')]; -- 1.8.1.4
participants (1)
-
Neer Sighted