Explorar o código

splitReplace fixed for not .split-table items

Herbert Vojčík %!s(int64=14) %!d(string=hai) anos
pai
achega
6bb350befa
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib-support/useful.js

+ 1 - 1
lib-support/useful.js

@@ -144,7 +144,7 @@ function etagCaching(etag) {
 function splitReplace(array, delimiter, o) {
   var i, j, k, l = 0, m = array.length;
   array.forEach(function (v, k, a) {
-    var split = a[k] = v.split(delimiter);
+    var split = a[k] = v.split ? v.split(delimiter) : [v];
     l += 2 * split.length - 1;
   });
   array.length = l;