From d06c3e3dd863f91565463ef8a70e76c02e619699 Mon Sep 17 00:00:00 2001 From: Enishowk Date: Wed, 27 Mar 2019 22:11:23 +0100 Subject: [PATCH] =?UTF-8?q?fix(xo-web/smart-backup):=20StringNode=20?= =?UTF-8?q?=E2=86=92=20RegExpNode=20to=20anchor=20strings=20(#4085)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4078 --- CHANGELOG.unreleased.md | 1 + packages/xo-web/src/common/smart-backup/index.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 483153a40..06f02f367 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -12,6 +12,7 @@ - [Home] Always sort the items by their names as a secondary sort criteria [#3983](https://github.com/vatesfr/xen-orchestra/issues/3983) (PR [#4047](https://github.com/vatesfr/xen-orchestra/pull/4047)) - [Remotes] Fixes `spawn mount EMFILE` error during backup - Properly redirect to sign in page instead of being stuck in a refresh loop +- [Backup-ng] No more false positives when list matching VMs on Home page [#4078](https://github.com/vatesfr/xen-orchestra/issues/4078) (PR [#4085](https://github.com/vatesfr/xen-orchestra/pull/4085)) ### Released packages diff --git a/packages/xo-web/src/common/smart-backup/index.js b/packages/xo-web/src/common/smart-backup/index.js index 8ad11d172..3c036f5d0 100644 --- a/packages/xo-web/src/common/smart-backup/index.js +++ b/packages/xo-web/src/common/smart-backup/index.js @@ -1,5 +1,5 @@ import * as CM from 'complex-matcher' -import { get, identity, isEmpty } from 'lodash' +import { escapeRegExp, get, identity, isEmpty } from 'lodash' import { EMPTY_OBJECT } from './../utils' @@ -59,7 +59,7 @@ export const constructSmartPattern = ( const valueToComplexMatcher = pattern => { if (typeof pattern === 'string') { - return new CM.String(pattern) + return new CM.RegExpNode(`^${escapeRegExp(pattern)}$`) } if (Array.isArray(pattern)) {