CustomVariable: fix rendering for keys starting...
...with numbers fixes #792
This commit is contained in:
parent
2bc477daaa
commit
25395656ce
|
@ -115,7 +115,7 @@ abstract class CustomVariable implements IcingaConfigRenderer
|
|||
|
||||
protected function renderKeyName($key)
|
||||
{
|
||||
if (preg_match('/^[a-z0-9_]+\d*$/i', $key)) {
|
||||
if (preg_match('/^[a-z][a-z0-9_]*$/i', $key)) {
|
||||
return 'vars.' . c::escapeIfReserved($key);
|
||||
} else {
|
||||
return 'vars[' . c::renderString($key) . ']';
|
||||
|
|
Loading…
Reference in New Issue