Ticket #1035 (closed defect: fixed)
evaluated macro parameters are computed twice
| Reported by: | FND | Owned by: | FND |
|---|---|---|---|
| Priority: | major | Milestone: | 2.6 |
| Component: | core | Version: | |
| Severity: | medium | Keywords: | |
| Cc: |
Description (last modified by FND) (diff)
As explained here, some macros' use of parseParams causes evaluated macro parameters to be computed twice:
invokeMacro calls the respective macro's handler while passing params.readMacroParams():
http://trac.tiddlywiki.org/browser/Trunk/core/js/main.js?rev=9473#L233
This in turn calls parseParams, which then computes evaluated parameters:
http://trac.tiddlywiki.org/browser/Trunk/core/js/Strings.js?rev=9473#L187
However, some macros - like tiddler - also call parseParams, which leads to evaluated parameters being computed twice in those cases.
Thus fixing this issue might be as simple as relying on parseParams's allowEval argument, setting it to false in macro handlers. (That, of course, would require plugin authors to be aware of this somewhat obscure issue.)
Test case:
<<tiddler {{alert(new Date()); ""}}>>
