From 1f0e8a162442af5877847a6246ad429e179cf42e Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Mon, 14 Nov 2022 12:38:27 +0100 Subject: [PATCH] asciidoc-pve: disallow certain characters in onlineHelp keys this removes the lazily evaluated part of the regex used to detect `onlineHelp` keys in order to match them with asciidoc anchors in the documentation. it uses a pattern that excludes curly braces, brackets and quotations instead. this allows for greedy matching and also removes an issue where keys that are set via CBind were included incorrectly. the script would try to find an anchor name that was equivalent to the CBind placeholder, which would fail. since brackets, curly braces and quotation marks aren't allowed in asciidoc anchors anyway, excluding them like this should be safe. Signed-off-by: Stefan Sterz --- asciidoc-pve.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asciidoc-pve.in b/asciidoc-pve.in index d638a38..49e54bd 100644 --- a/asciidoc-pve.in +++ b/asciidoc-pve.in @@ -465,7 +465,7 @@ sub scan_extjs_file { debug("scan-extjs $filename"); while(defined(my $line = <$fh>)) { - if ($line =~ m/\s+onlineHelp:\s*[\'\"](.*?)[\'\"]/) { + if ($line =~ m/\s+onlineHelp:\s*[\'\"]([^{}\[\]\'\"]+)[\'\"]/) { my $blockid = $1; my $link = $fileinfo->{blockid_target}->{default}->{$blockid}; die "undefined blockid '$blockid' ($filename, line $.)\n" -- 2.39.2