helper: str replace function should replace all instances of placeholder

This commit is contained in:
eberhab 2016-04-20 14:04:46 +02:00 committed by PetaByteBoy // Milan Pässler
parent 31545c758d
commit bc7e7888a5
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ function localStorageTest() {
function listReplace(s, subst) {
for (key in subst) {
s = s.replace(key, subst[key])
var re = new RegExp(key, 'g');
s = s.replace(re, subst[key])
}
return s
}