Commit 99138d2
[bugfix] Preserve a literal "+" in resource names on decode
db:to-display decoded names with xmldb:decode-uri, which form-decodes "+"
to a space (the x-www-form-urlencoded convention; eXist-db/exist#1824).
But a "+" in a stored name is always a literal "+" -- spaces are stored as
%20 -- and db:to-stored (fn:iri-to-uri) leaves "+" untouched on the encode
side, so a name like "naïve+test.xml" stored correctly but read back as
"naïve test.xml".
Protect a literal "+" as %2B before xmldb:decode-uri so it decodes back to
"+", restoring symmetry with the encode side. This mirrors what
URIUtils.decodeForURI (the core fix in eXist-db/exist#6451) does, applied
at the API layer so it is correct independent of the core build, and
forward-compatible once #6451 lands. Spaces (%20) are unaffected.
Verified end-to-end against a live instance: "naïve+test.xml" stores as
na%C3%AFve+test.xml on disk, lists and reads back as naïve+test.xml. Adds
the "+" case to the Cypress awkward-name coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 261bc73 commit 99138d2
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
821 | 823 | | |
822 | 824 | | |
823 | 825 | | |
| |||
0 commit comments