mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 08:36:01 +00:00
[FIXED JENKINS-16660] Allow variable names with dots in bracketed references.
Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would
evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the
current ${A.B}.
Existing ${A.B}-like references will break (not evaluate to ${A.B}) if
there actually is an A.B variable defined, which I think is very
unlikely.
This commit is contained in:
1 parent
ba432da2b5
commit
3376cf0158
2 files changed
+7
-2
No files matched your search
@@ -112,9 +112,9 @@ public class Util {
|
||||
}
|
||||
|
||||
/**
|
||||
* Pattern for capturing variables. Either $xyz or ${xyz}, while ignoring "$$"
|
||||
* Pattern for capturing variables. Either $xyz, ${xyz} or ${a.b} but not $a.b, while ignoring "$$"
|
||||
*/
|
||||
private static final Pattern VARIABLE = Pattern.compile("\\$([A-Za-z0-9_]+|\\{[A-Za-z0-9_]+\\}|\\$)");
|
||||
private static final Pattern VARIABLE = Pattern.compile("\\$([A-Za-z0-9_]+|\\{[A-Za-z0-9_.]+\\}|\\$)");
|
||||
|
||||
/**
|
||||
* Replaces the occurrence of '$key' by <tt>properties.get('key')</tt>.
|
||||
|
||||
Reference in new issue
Block a user