summaryrefslogtreecommitdiff
path: root/data/js
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-03 11:12:14 +0200
committerYorhel <git@yorhel.nl>2015-09-03 11:12:14 +0200
commitd9891b03a079155e2c3cd488bab1b05a35038f93 (patch)
tree3ea5aeaadceafbc919ba3af8e899587ed43ef7d5 /data/js
parent0f5ffc361079110bd7448c6a8ad2e13abe8ed84b (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.js2
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, ']');
};