diff --git a/ui/app/utils/escape-task-name.js b/ui/app/utils/escape-task-name.js index fff0e4741f8..ce92a5e5498 100644 --- a/ui/app/utils/escape-task-name.js +++ b/ui/app/utils/escape-task-name.js @@ -1,4 +1,4 @@ export default function escapeTaskName(taskName) { // Regular expression is taken from here: https://stackoverflow.com/a/20053121 - return taskName.replace(/[^a-zA-Z0-9,._+@%/-]/g, '\\$&'); + return taskName.replace(/[^a-zA-Z0-9,._+@%/-]/gu, '\\$&'); } diff --git a/ui/tests/unit/utils/escape-task-name-test.js b/ui/tests/unit/utils/escape-task-name-test.js index b34ab2430ea..649d2acce70 100644 --- a/ui/tests/unit/utils/escape-task-name-test.js +++ b/ui/tests/unit/utils/escape-task-name-test.js @@ -6,5 +6,6 @@ module('Unit | Utility | escape-task-name', function() { assert.equal(escapeTaskName('plain'), 'plain'); assert.equal(escapeTaskName('a space'), 'a\\ space'); assert.equal(escapeTaskName('dollar $ign'), 'dollar\\ \\$ign'); + assert.equal(escapeTaskName('emojišŸ„³'), 'emoji\\šŸ„³'); }); });