jszip
Advanced tools
Comparing version 2.6.1 to 2.7.0
@@ -7,2 +7,7 @@ --- | ||
#### v2.7.0 2022-08-02 | ||
- Fix: Use a null prototype object for this.files (see [#824](https://github.com/Stuk/jszip/pull/824)) | ||
+ This change might break existing code if it uses prototype methods on the .files property of a zip object, for example zip.files.toString(). This approach is taken to prevent files in the zip overriding object methods that would exist on a normal object. | ||
### v2.6.1 2016-07-28 | ||
@@ -81,2 +86,1 @@ - update pako to v1.0.2 to fix a DEFLATE bug (see [#322](https://github.com/Stuk/jszip/pull/322)). | ||
- First release after a long period without version. | ||
@@ -32,3 +32,6 @@ 'use strict'; | ||
// } | ||
this.files = {}; | ||
// NOTE: we use a null prototype because we do not | ||
// want filenames like "toString" coming from a zip file | ||
// to overwrite methods and attributes in a normal Object. | ||
this.files = Object.create(null); | ||
@@ -35,0 +38,0 @@ this.comment = null; |
@@ -618,5 +618,2 @@ 'use strict'; | ||
for (filename in this.files) { | ||
if (!this.files.hasOwnProperty(filename)) { | ||
continue; | ||
} | ||
file = this.files[filename]; | ||
@@ -765,5 +762,2 @@ // return a new object, don't let the user mess with our internal objects :) | ||
for (var name in this.files) { | ||
if (!this.files.hasOwnProperty(name)) { | ||
continue; | ||
} | ||
var file = this.files[name]; | ||
@@ -770,0 +764,0 @@ |
{ | ||
"name": "jszip", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"author": "Stuart Knightley <stuart@stuartk.com>", | ||
@@ -5,0 +5,0 @@ "description": "Create, read and edit .zip files with Javascript http://stuartk.com/jszip", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
618278
39
11657