Skip to content

Commit 781c384

Browse files
authored
This closes #1889, refs #1732 and #1735 (#1890)
Saving workbook with reverse sorted internal part path to keep same hash of identical files and fix incorrect MIME type
1 parent 7715c14 commit 781c384

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (f *File) writeToZip(zw *zip.Writer) error {
212212
files = append(files, path.(string))
213213
return true
214214
})
215-
sort.Strings(files)
215+
sort.Sort(sort.Reverse(sort.StringSlice(files)))
216216
for _, path := range files {
217217
var fi io.Writer
218218
if fi, err = zw.Create(path); err != nil {
@@ -228,7 +228,7 @@ func (f *File) writeToZip(zw *zip.Writer) error {
228228
tempFiles = append(tempFiles, path.(string))
229229
return true
230230
})
231-
sort.Strings(tempFiles)
231+
sort.Sort(sort.Reverse(sort.StringSlice(tempFiles)))
232232
for _, path := range tempFiles {
233233
var fi io.Writer
234234
if fi, err = zw.Create(path); err != nil {

0 commit comments

Comments
 (0)