Closed smoldaner closed 5 years ago
I think there are two separate issues here: a bug and a docs bug.
allowExpressions
is meant to completely disallow evaluating any expressions, including pre-parsed expressions in a template, in case that you don't trust your templates at all. The docs don't make that particularly clear.
The bug is that partials loaded from a template object don't currently preload their expression payload to make them available without re-parsing.
I have a fix for the bug ready, and I'll get the docs bug in a bit.
The fix is now published on edge, and will be cherry-picked over to 1.3 and 1.2 branches when the next releases are cut.
Description:
Pre-parsed partials and templates cannot be used on environments that enforce a strict Content Security Policy (CSP).
It turns out that only expressions in partials/templates used in components are successfully pre-converted to functions. In the root ractive instance the the pre-parsed expression functions are ignored.
See #3285 for a similar issue
Versions affected:
1.3.6
Platforms affected:
All pages that enforce a strict CSP policy
Reproduction:
Using a pre-parsed templates/partials with expression functions and
csp: true
andallowExpressions: false
options. See JSFiddle TestcaseThe fiddle uses pre-compiled templates/partials (with expressions functions) generated via
from the following templates:
template:
template2:
partial:
Testcode: