BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
661 stars 268 forks source link

base-uri() produces "Invalid URI: ..." for file with square brackets in name #2180

Closed jperterm closed 1 year ago

jperterm commented 1 year ago

Description of the Problem

When I execute collection('...')/base-uri() on a database which has a file/document named [Content_Types].xml, I get Invalid URI: /some-db/[Content_Types].xml.

[Content_Types].xml files are part of the Open Packaging Conventions, which e.g. is used for packaging OOXML (DOCX files etc.).

Expected Behavior

I expect the URI have escaped square brackets and produce /some-db/%5BContent_Types.xml%5D.xml.

Steps to Reproduce the Behavior

  1. Create a [Content_Types].xml file with valid xml.
  2. Create and open a database some-db with file above.
  3. Run collection('some-db')/base-uri()

Do you have an idea how to solve the issue?

No response

What is your configuration?

ChristianGruen commented 1 year ago

True, we need to fix this. There's already an open issue for that (#1172), so I'll close yours.

Until this is fixed, you can use helper functions of our Database Module instead(db:name, db:path).

jperterm commented 1 year ago

Ah, thanks for the hint with the helper functions. I already tried to find something alike.