mraible opened a new pull request, #317:
URL: https://github.com/apache/roller/pull/317

   Three changes to how weblog templates render:
   
   - **Render limits.** A render now stops with a logged error, and the request 
fails like any other rendering error, once it writes more than 
`rendering.maxOutputChars` (10 MB by default) or runs longer than 
`rendering.maxRenderSeconds` (30 by default). The output writer, `#foreach` (a 
`RollerForeach` directive), method calls, property reads, iteration and 
inserted values all check the limits, and `#foreach` stops at 
`directive.foreach.max_loops` (100,000) passes. `String.repeat` isn't available 
to templates. The secure uberspector still applies; the new 
`RenderLimitUberspector` is chained after it.
   - **Templates per weblog.** While a weblog renders, `#parse` and `#include` 
load only that weblog's own stored templates; others are not found. The public 
error pages no longer show template ids (they stay in the log), and parse 
messages name the template.
   - **Inline macros per template.** `velocimacro.inline.local_scope=true` with 
`inline.replace_global=true`: macros defined inline in a template are local to 
that template and the render it starts, so two weblogs can use the same macro 
name and an edited macro takes effect on the next render. Library macros 
(`roller.vm`, `weblog.vm` and a site's own library such as `roller-custom.vm`) 
stay global, and a page can still call macros from a template it `#parse`s.
   
   Tests: `RenderLimitsTest` and `WeblogTemplateScopeTest` (DB-backed); twelve 
of their cases fail without the change. `mvn test` passes (762 tests), and the 
Playwright database-login suite passes (20 run, 3 OIDC tests skipped).
   
   Still possible: a macro that only calls itself, with no output, isn't 
stopped by the deadline.
   
   CHANGES entries for this and the related fixes will come in one PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to