on darcs DW checked out on 2007-02-05 16:42 GMT.
When useheading is true and when clicking on Index, if the list of pages is big, you get errors complaining about a too big regexps.
After investigation, it appears that the preConnect() functions of the different parsers are called several times via:
parse /support/wiki/inc/parser/parser.php 117
parse /support/wiki/inc/parserutils.php 214
p_get_instructions /support/wiki/inc/parserutils.php 183
p_cached_instructions /support/wiki/inc/parserutils.php 382
p_render_metadata /support/wiki/inc/parserutils.php 235
p_get_metadata /support/wiki/inc/parserutils.php 574
p_get_first_heading /support/wiki/inc/parser/xhtml.php 999
_getLinkTitle /support/wiki/inc/parser/xhtml.php 484
internallink /support/wiki/inc/html.php 25
html_wikilink /support/wiki/inc/html.php 691
html_list_index /support/wiki/inc/html.php 777
html_buildlist /support/wiki/inc/html.php 671
html_index /support/wiki/inc/template.php 97
tpl_content_core /support/wiki/inc/events.php 91
trigger /support/wiki/inc/events.php 197
trigger_event /support/wiki/inc/template.php 45
tpl_content /support/wiki/lib/tpl/emerson/main.php 153
include /support/wiki/inc/actions.php 126
act_dispatch /support/wiki/doku.php 75
For some of those parsers (like externallink), that means that each time, a new (same) set of patterns is added to the global regexp. So after about 15 iterations, you reach a limit. It also makes it very slow.
This happens because the same "modes" are reused (see p_get_parsermodes). They were already preConnect'ed, so there should need to preConnect them again, but they happen to be via parse()->connectModes() when rendering the metadata to get the "title".
Please find a fix attached. That fix makes sure that the preConnect functions of the various parsers don't dupplicate their internal patterns. Maybe a better fix would be to make sure those preConnect()s are not called several times.