浏览代码

The error in the method getItemField (#2537)

In actual version of bootstrap-table (1.11.0) found an error that occurs when if the application code is available code: 
Array.prototype.xxx = function () {}

To fix the error in the method getItemField should be added to the condition with hasOwnProperty:
for (var p in props) {
    if (props.hasOwnProperty(p)) {
        value = value && value[props[p]];
    }
}
gaddiman 9 年之前
父节点
当前提交
60a8c3bcd5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/bootstrap-table.js

+ 3 - 1
src/bootstrap-table.js

@@ -210,7 +210,9 @@
         }
         var props = field.split('.');
         for (var p in props) {
-            value = value && value[props[p]];
+            if (props.hasOwnProperty(p)) {
+                value = value && value[props[p]];
+            }
         }
         return escape ? escapeHTML(value) : value;
     };