From c8be03ee8aef0e0b930e6432bf786acf10cee979 Mon Sep 17 00:00:00 2001 From: ready-research <72916209+ready-research@users.noreply.github.com> Date: Thu, 26 Aug 2021 18:30:55 +0530 Subject: [PATCH] Security fix for ReDoS --- src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index 2a62f784..09197ef1 100644 --- a/src/util.js +++ b/src/util.js @@ -30,7 +30,7 @@ export function nextTick(cb, ctx) { } export function trim(str) { - return str ? str.replace(/^\s*|\s*$/g, '') : ''; + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); } export function trimEnd(str, chars) {