orthros / dart-epub

Epub Reader and Writer for Dart
MIT License
218 stars 226 forks source link

Epub parsing error when href is a ralative path #67

Open izhoubin opened 5 years ago

izhoubin commented 5 years ago

navigation_reader.dart:

String tocFileEntryPath =
        ZipPathUtils.combine(contentDirectoryPath, tocManifestItem.Href);

zip_path_utils.dart:

static String combine(String directory, String fileName) { 
    if (directory == null || directory == "") {
      return fileName;
    } else {
      return directory + "/" + fileName;
    }
  }
}

If the tocManifestItem.Href is a ralative path such as "./toc.ncx",the method combine() will return wrong path like OEBPS/./toc.ncx,and error occurred.

Ralative path should be considered in method combine.

Thanks.