Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.120 -r1.121 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 26 Jun 2007 10:19:34 -0000 1.120 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 26 Jun 2007 10:51:27 -0000 1.121 @@ -520,10 +520,18 @@ } Page instproc include {ch arg ch2} { - [self class] instvar recursion_depth + # make recursion depth a global variable to ease the deletion etc. + if {[catch {incr ::xowiki_recursion_depth}]} { + set ::xowiki_recursion_depth 1 + } + if {$::xowiki_recursion_depth > 10} { + return "${ch}
Error in includelet '{{$arg}}' in page [my set name]:
\n\ + Nesting of pages is to deep
" + } if {[regexp {^adp (.*)$} $arg _ adp]} { if {[catch {lindex $adp 0} errMsg]} { # there is something syntactically wrong + incr ::xowiki_recursion_depth -1 return "${ch}
Error in '{{$arg}}' in [my set name] ($errMsg)
\n\ Syntax: adp <name of adp-file> {<argument list>}
\n Invalid argument list: '$adp'; must be attribute value pairs (even number of elements)
" @@ -533,6 +541,7 @@ if {![string match "/*" $adp_fn]} {set adp_fn /packages/xowiki/www/$adp_fn} set adp_args [lindex $adp 1] if {[llength $adp_args] % 2 == 1} { + incr ::xowiki_recursion_depth -1 return "${ch}
Error in '{{$arg}}'
\n\ Syntax: adp <name of adp-file> {<argument list>}
\n Invalid argument list: '$adp_args'; must be attribute value pairs (even number of elements)
" @@ -542,6 +551,7 @@ if {[catch {set page [template::adp_include $adp_fn $adp_args]} errorMsg]} { # in case of error, reset the adp_level to the previous value set ::template::parse_level $including_page_level + incr ::xowiki_recursion_depth -1 return "${ch}
Error during evaluation of '{{$arg}}' in [my set name]
\n\ adp_include returned error message: $errorMsg
\n" } @@ -554,6 +564,7 @@ regsub -all {([^\\])"} $arg "\\1\"" arg set html [my include_portlet $arg] #my log "--include portlet returns $html" + incr ::xowiki_recursion_depth -1 return $ch$html$ch2 } }