andreareider / epubcheck

Automatically exported from code.google.com/p/epubcheck
0 stars 0 forks source link

raise error with href="./foo.html" in HTML file #270

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PROBLEM:

When I use link like <a href="./foo.html"> in HTML, epubcheck raise error:

"'OEBPS/./foo.html': referenced resource missing in the package."

I guess it's bug of com.adobe.epubcheck.util.PathUtil.normalizePath().

METHOD:

PathUtil.normalizePath("foo/./bar")

RESULT:

"foo/./bar"

EXPECTED:

"foo/bar"

PLATFORM:

$ mvn --version
Apache Maven 3.0.3 (r1075438; 2011-03-01 02:31:09+0900)
Maven home: /usr/share/maven
Java version: 1.7.0_13, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre
Default locale: ja_JP, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.3", arch: "x86_64", family: "mac"

ADDITIONAL INFO:

I attached my test file 
src/test/java/com/adobe/epubcheck/util/PathUtilTest.java.

Original issue reported on code.google.com by takahash...@gmail.com on 23 May 2013 at 1:00

Attachments:

GoogleCodeExporter commented 8 years ago
I made a patch to pass this test. Please see PathUtil.java.diff.

It might be fix to remove two lines in normalizePath():

                 if (path.indexOf("..") < 0)
                        return path;

(but it's slow??)

Original comment by takahash...@gmail.com on 23 May 2013 at 1:32

GoogleCodeExporter commented 8 years ago
sorry, file is missing, attached again.

Original comment by takahash...@gmail.com on 23 May 2013 at 4:14

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r469.

Original comment by tledou...@gmail.com on 27 May 2013 at 8:37

GoogleCodeExporter commented 8 years ago

Original comment by rdeltour@gmail.com on 27 May 2013 at 10:28