Added validation when a empty value is sent to mb_strlen function

This commit is contained in:
Julio Cesar Laura
2012-11-12 18:48:15 -04:00
parent 022f55f7a1
commit c67cf39f83
2 changed files with 2 additions and 1 deletions

View File

@@ -2127,6 +2127,7 @@ function stringReplace(strSearch, stringReplace, str)
}
var mb_strlen = function(str) {
str = str || '';
var len = 0;
for (var i = 0; i < str.length; i++) {
len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? 2 : 1;