Commit 5d09d7f
committed
(PUP-11515) Negative Lookbehind Regex Causes Duplicate Node
Before this commit, two nodes could collide due to the lookaround
Regex pattern. This issue arose because the regex was converted to
a regular string by ignoring characters other than a-z, 0-9, _, and -.
For example, /(?<!a)sync/ was converted to "__node_regexp__async,"
and /async/ was also converted to "__node_regexp__async," causing
an error that the node was already defined.
To prevent such duplication, this commit normalize the lookarround
pattern from the regex, ensuring a unique string in case
of lookarround pattern conflict.
For example, /(?<!a)sync/ will converted to "__node_regexp__LPQULTEXaRPsync"
replacing (?<!a) to "LPQULTEXaRP" while converting to the string.1 parent bda54a7 commit 5d09d7f
File tree
2 files changed
+24
-1
lines changed- lib/puppet/resource
- spec/integration/parser
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
196 | 206 | | |
197 | 207 | | |
198 | 208 | | |
199 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
200 | 214 | | |
201 | 215 | | |
202 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
88 | 97 | | |
89 | 98 | | |
90 | 99 | | |
| |||
0 commit comments