mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 19:30:36 -06:00
Validate query to avoid self-reference of variable #7614
This commit is contained in:
parent
9efb6e76e9
commit
555acacd6d
@ -77,6 +77,11 @@ export class VariableEditorCtrl {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($scope.current.type === 'query' && $scope.current.query.match(new RegExp('\\$' + $scope.current.name))) {
|
||||
$scope.appEvent('alert-warning', ['Validation', 'Query contains variable self-reference']);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user