diff options
author | Yorhel <git@yorhel.nl> | 2015-09-03 11:12:14 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-09-03 11:12:14 +0200 |
commit | d9891b03a079155e2c3cd488bab1b05a35038f93 (patch) | |
tree | 3ea5aeaadceafbc919ba3af8e899587ed43ef7d5 /data/js | |
parent | 0f5ffc361079110bd7448c6a8ad2e13abe8ed84b (diff) |
JS: Fix argument replacement regexp in mt()
This caused every [_#] to be replaced multiple times.
Diffstat (limited to 'data/js')
-rw-r--r-- | data/js/lib.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/data/js/lib.js b/data/js/lib.js index 72925a93..b01a93c8 100644 --- a/data/js/lib.js +++ b/data/js/lib.js @@ -175,7 +175,7 @@ window.mt = function() { var val = VARS.l10n_str[key] || key; // BUG: ~[_1] will get replaced. We don't have a string like that, so whatever. for(var i=1; i<arguments.length; i++) - val = val.replace(new RegExp('\[_'+i+'\]', 'g'), arguments[i]); + val = val.replace(new RegExp('\\[_'+i+'\\]', 'g'), arguments[i]); return val.replace(/~\[/g, '[').replace(/~\]/g, ']'); }; |