I'm certainly no expert for the MediaWiki parser, but you could take a
microtime() from the start of parsing and periodically check time
elapsed. With anything beyond the allotted parsing time, the template
would return either nothing or a warning.
David Gerard wrote:
On 19/01/07, David Strauss
<david(a)fourkitchens.com> wrote:
#loop is a problem. If this template language is
Turing-complete, it can
be used to run infinitely long programs. That is a huge avenue for abuse.
Then again, there could be an execution limit to the parsing of a template.
We have one real-life example of this, of course, in the recent
template on es: Wikipedia that took 20 seconds to run and caused some
annoyance on wikitech-l ... how feasible are execution time limits in
practice, what's a reasonable limit (knowing people are going to push
as close to it as they can) and what's a reasonable failure mode
(knowing people are going to push as close to it as they can)?
- d.
_______________________________________________
foundation-l mailing list
foundation-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/foundation-l