| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| Mustache.php v3.2.0 source code.tar.gz | 2026-05-10 | 45.4 kB | |
| Mustache.php v3.2.0 source code.zip | 2026-05-10 | 69.8 kB | |
| README.md | 2026-05-10 | 2.1 kB | |
| Totals: 3 Items | 117.3 kB | 0 | |
This release fixes a longstanding inheritance spec compliance bug, adds opt-in strict handling for missing tags, hardens filesystem template loading, and improves rendering diagnostics.
New:
- Add
debug_rendering, an engine option for capturing the active Mustache tag stack when rendering fails. UseDEBUG_RENDERING_ON_EXCEPTIONto retry failed renders with debug traces, orDEBUG_RENDERING_ALWAYSto compile traces into every render. - Add
strict_tags, a bitmask-based engine option for treating missing interpolation values, sections, partials, parent templates, and extra block overrides as failures.
Improved:
- Fix a longstanding inheritance spec compliance bug with nested parent templates. Nested layouts can now safely reuse common block names like
content; overrides stay scoped to the parent they belong to instead of leaking outward and causing surprising recursion. - Harden
FilesystemLoaderagainst path traversal and null-byte template names, including dynamic partial and parent names. - Non-stringable output failures now throw clear exceptions. Defaults match previous Mustache.php behavior, but
strict_tagscan now relax coercion to render these values as empty strings. - Context lookup now respects method visibility. Private and protected methods are treated as missing values rather than throwing exceptions.
- README and repository metadata cleanup. Thanks @michaelwood and @reedy.
Heads up:
DEBUG_RENDERING_ALWAYSadds trace collection to every render, with up to 25% overhead. It is useful in development, but probably not what you want all the time.DEBUG_RENDERING_ON_EXCEPTIONkeeps successful renders fast and only pays the tracing cost after a failure. Failed templates render twice, so watch out for side effects in lambdas, helpers, or custom escaping callbacks. You don't have those in your data model, right? Right?
[!NOTE]
FilesystemLoadernow rejects template names that resolve outside the configured base directory. To preserve the old behavior, passallow_unsafe_template_names => true. This is not recommended.