Skip to content

Bug in w3c/epubcheck/src/main/java/com/adobe/epubcheck/util/PathUtil.java #1181

@kevinhendricks

Description

@kevinhendricks

It is valid to have user.dir value set to root ("/") (and this happens when subprocesses are used to launch the epubcheck via the commandline) but this routine then breaks all paths:

static final String workingDirectory  = System.getProperty("user.dir");
 public static String removeWorkingDirectory(String path)
  {
    if (path == null || path.length() == 0)
    {
      return path;
    }
    return path.replace(workingDirectory, ".");
  }

By replacing all "/" chars in path to "." chars. Given "." chars are valid in filenames and directory names, this replacement is unfixable.

Please make this routine robust to all possible legal values for user.dir

Metadata

Metadata

Assignees

Labels

status: has PRThe issue is being processed in a pull requesttype: bugThe issue describes a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions