Skip to content

Commit 3547c66

Browse files
author
Thomas Taschauer
committed
attempt to fix iWorks documents
1 parent 1ec48cb commit 3547c66

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

OpenDocumentReader/DocumentViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,12 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
337337
}
338338

339339
func documentLoadingError(_ doc: Document, errorCode: Int) {
340+
// attention: wrong for extensions like ".pages.zip"
340341
let fileType = doc.fileURL.pathExtension.lowercased()
342+
343+
let fileName = doc.fileURL.absoluteString.lowercased()
341344
for type in EXTENSION_WHITELIST {
342-
if (!fileType.starts(with: type)) {
345+
if (!fileName.hasSuffix(type)) {
343346
continue
344347
}
345348

0 commit comments

Comments
 (0)