domma-cms 1.8.34 → 1.8.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.35] - 2026-10-21
4
+
5
+ - **Missing pages answer 404 again on sites without their own 404 page.** Since 1.8.29 such a site answered every missing address with a server error, because the built-in 404 and 403 pages called a helper that had been moved away. The address shown on those pages is escaped, as before.
6
+
3
7
  ## [1.8.34] - 2026-10-21
4
8
 
5
9
  - **Docs, Garage, Messages and Theme Roller are free, and come with Domma CMS.** They need no licence any more, on your own server or ours, and ship in the engine beside Blog, Booking and the other free Tools - switched off until you switch them on. Sites that already have them keep their data and settings; the update replaces the licensed copy with the free one. Docs 2.14.0, Garage 1.6.0, Messages 1.9.0, Theme Roller 1.3.0. Docs Pro stays a paid Tool.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.8.34",
3
+ "version": "1.8.35",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -44,6 +44,22 @@ export function getBaseUrl(request) {
44
44
  import {sendHtml} from '../services/htmlResponse.js';
45
45
  export {sendHtml};
46
46
 
47
+ /**
48
+ * Escape user-controlled strings before interpolating into HTML.
49
+ * Prevents reflected XSS in the built-in 403 and 404 pages.
50
+ *
51
+ * @param {string} str
52
+ * @returns {string}
53
+ */
54
+ function escapeHtml(str) {
55
+ return String(str)
56
+ .replace(/&/g, '&')
57
+ .replace(/</g, '&lt;')
58
+ .replace(/>/g, '&gt;')
59
+ .replace(/"/g, '&quot;')
60
+ .replace(/'/g, '&#39;');
61
+ }
62
+
47
63
  export async function publicRoutes(fastify) {
48
64
  // Admin panel: serve index.html for all /admin/* paths (SPA fallback)
49
65
  fastify.get('/admin', async (request, reply) => {