diff --git a/client/src/actions/index.js b/client/src/actions/index.js index 4f4b6b20363..c634d630c5f 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -638,7 +638,11 @@ export const toggleBlocking = ( }; export const toggleBlockingForClient = (type, domain, client) => { - const baseRule = `||${domain}^$client='${client.replace(/'/g, '/\'')}'`; + const escapedClientName = client.replace(/'/g, '\\\'') + .replace(/"/g, '\\"') + .replace(/,/g, '\\,') + .replace(/\|/g, '\\|'); + const baseRule = `||${domain}^$client='${escapedClientName}'`; const baseUnblocking = `@@${baseRule}`; return toggleBlocking(type, domain, baseRule, baseUnblocking);