Item15075: deep recursion on innocent code
Priority: Urgent
Current State: Closed
Released In: 2.1.8
Target Release: patch
Applies To: Engine
Component:
Branches: Release02x01 master
This here once worked:
* Set MYMACRO = This a test for web %web{default="%WEB%"}%
However this expands to:
You type |
You get |
Should be |
%MYMACRP% |
This a test for web Tasks |
This a test for web Task |
%MYMACRO{}% |
This a test for web Tasks |
This a test for web Task |
%MYMACRO{"yolo"}% |
This a test for web WEB |
This a test for web Task |
The third example creates an entry in Foswiki's error.log
Max recursive depth reached: %WEB% at Tasks.Item15075
every time this topic is loaded. However there is no recursion happening here other than the default that has to be expanded while expanding %MYMACRO.
It seems there is a long standing error in
Foswiki.pm
where
_expandMacroOnTopicRendering()
is calling
_processMacros()
with a depth of 1 for its
attributes ... which immediately results in a max recursion warning.
This must be raised to the normal value as being used elsewhere when calling
_processMacros()
with an initial depth value of 16.
--
MichaelDaum - 29 Mar 2022