Skip to content

MD.Scribe 3.6.3 — Errata

Latest

Choose a tag to compare

@paulmann paulmann released this 14 Nov 20:21

MD.Scribe 3.6.3 — Errata

An errata slip lists what a book got wrong. Both fixes here were found the same way: by opening a page that had been working and getting a 404.

Fixed

  • The library listed file names with their first character missing. scan() walks a base directory that the path validator returns already resolved through realpath(), then built each relative path with substr($full, strlen($root)) — where $root was the unresolved browse root. When the content directory is a symlink (the documented release layout: <release>/content -> mdscribe-data/content) the two prefixes differ in length, the cut lands inside the last segment, and every file in a sub-directory loses its first letter. Measured in production: index.md was listed as ndex.md and autoyap-roles-security-2026-11-13.md as utoyap-roles-security-2026-11-13.md, so every link the browser offered answered 404 while the viewer itself was fine. Paths are now relative to the same resolved root the walk started from, and a path outside it is logged and skipped instead of being truncated. Three tests build that layout; with the old arithmetic all three fail.
  • A config that cannot be read is no longer replaced with defaults. Config::load() treated "file exists" as "file is readable", carried on with empty values and called appendMissingKeys(), which rewrote the file — destroying whatever it held. Measured in production: a config written by the CLI as root:root 0640 was unreadable for the pool user, and the next request replaced 1 166 bytes of settings with defaults, taking the site name and the home document with it, without a word in the log. readIniFile() now distinguishes parsed keys, an empty or absent file (a legitimate first run) and an existing file that cannot be read; in the last case the app runs on defaults, marks the config unwritable and logs the failure.

Verification

  • PHPUnit on Linux as a non-root user: OK (241 tests, 865 assertions), 0 skipped — the unreadable-config and dangling-symlink cases cannot be staged on Windows.
  • PHPStan level 6 clean; doctrine checker 12 checks, 0 errors, 0 warnings.
  • Archive MD.Scribe-3.6.3.zip, 4 272 892 bytes, sha256 80da2cc0…, 988 manifest entries; verify-release 17 checks, 0 failed, including the 21-check browser gate.

Upgrade: replace the application tree with the archive, keep content/, storage/ and .md.ini, reset opcache. Every file is verified against the manifest embedded in the archive.