You are here: Foswiki>Tasks Web>Item15075 (06 Aug 2023, MichaelDaum)Edit Attach

Item15075: deep recursion on innocent code

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.8
Target Release: patch
Applies To: Engine
Component:
Branches: Release02x01 master
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
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

 
Topic revision: r3 - 06 Aug 2023, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy