Skip to content

Commit 6abaa39

Browse files
update name validation to check for valid variable names
1 parent 57c1051 commit 6abaa39

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎ProcessMaker/Models/EnvironmentVariable.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ public function getValueAttribute()
6262
public static function rules($existing = null)
6363
{
6464
$unique = Rule::unique('environment_variables')->ignore($existing);
65+
$validVariableName = '/^[a-zA-Z][a-zA-Z_$0-9]*$/';
6566

6667
return [
6768
'description' => 'required',
6869
'value' => 'nullable',
69-
'name' => ['required', 'alpha_dash', $unique]
70+
'name' => ['required', "regex:${validVariableName}", $unique],
7071
];
7172
}
7273

0 commit comments

Comments
 (0)