diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-23 07:18:52 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-23 08:19:53 -0400 |
| commit | 26aba525c0c55cb0ec77cf3a788cb59de2683cee (patch) | |
| tree | c49c119f157c67b39746157c1851f595749911ac /src/sisudoc/ocda/io_in/read_zip_pod.d | |
| parent | help: what spine takes, what an artefact carries (diff) | |
uid and paths separator "~" in place of ":"
need a character to split filenames on in certain circumstances.
there problems with use of a colon in filenames, which is legal on posix
but not on Windows."~" fits the bill better being legal on every
filesystem of interest and is unreserved in rfc 3986, needing no escaping in a url.
The reference abstraction is renamed, its content unchanged. Over
the sample collection two filenames move and nothing else does: the
abstraction and database digests are identical, the archive's
members and their sizes are unchanged, and only the member order
shifts, "~" collating after letters where ":" sorted before them. The
document's epub dc:identifier is a v5 uuid derived from the uid, so it
changes for those filenames.
Every document's uid changes in the search database (spine.search.db).
(assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/ocda/io_in/read_zip_pod.d')
| -rw-r--r-- | src/sisudoc/ocda/io_in/read_zip_pod.d | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sisudoc/ocda/io_in/read_zip_pod.d b/src/sisudoc/ocda/io_in/read_zip_pod.d index 18a957c..c96429b 100644 --- a/src/sisudoc/ocda/io_in/read_zip_pod.d +++ b/src/sisudoc/ocda/io_in/read_zip_pod.d @@ -75,8 +75,10 @@ template spineExtractZipPod() { alias MAX_ENTRY_COUNT = MAX_POD_ENTRY_COUNT; enum size_t MAX_PATH_DEPTH = 10; /+ max path components +/ - /+ allowed entry name pattern: alphanumeric, dots, dashes, underscores, forward slashes +/ - static auto rgx_safe_entry_name = ctRegex!(`^[a-zA-Z0-9._/ -]+$`); + /+ allowed entry name pattern: alphanumeric, dots, dashes, underscores, + forward slashes, and "~", spine's own uid separator (as carried_names.d) + +/ + static auto rgx_safe_entry_name = ctRegex!(`^[a-zA-Z0-9._/ ~-]+$`); struct ZipPodResult { string tmp_dir; /+ temp directory containing extracted pod +/ |
