InfluxDB: Fix nested variable interpolation (#104067)
Validate query type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { cloneDeep, extend, has, isString, map as _map, omit, pick, reduce } from 'lodash';
|
||||
import { map as _map, cloneDeep, extend, has, isString, omit, pick, reduce } from 'lodash';
|
||||
import { lastValueFrom, merge, Observable, of, throwError } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@@ -359,7 +359,9 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
|
||||
// If matches are found this regex is evaluated to check if the variable is contained in the regex /^...$/ (^ and $ is optional)
|
||||
// i.e. /^$myVar$/ or /$myVar/ or /^($myVar)$/
|
||||
const regex = new RegExp(`\\/(?:\\^)?(.*)(\\$${variable.name})(.*)(?:\\$)?\\/`, 'gm');
|
||||
if (!query) {
|
||||
|
||||
// We need to validate the type of the query as some legacy cases can pass a query value with a different type
|
||||
if (!query || typeof query !== 'string') {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user