Skip to content

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

Closed

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

Activity

  1. self-assigned this
    on Aug 24, 2020
  2. added this to the v4.2.5 milestone on Aug 24, 2020
  3. rdeltour commented on Aug 24, 2020

    @rdeltour
    Member

    Thanks for the report 👍, I'll look into it tentatively for the next maintenance release!

  4. added a commit that references this issue on Feb 26, 2021
    6fb03fc
  5. added
    status: has PRThe issue is being processed in a pull request
    and removed on Feb 26, 2021
  6. added a commit that references this issue on Feb 26, 2021
    5ee72e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    ⌂ 换网址