Generated node count limit
authorTim Starling <tstarling@wikimedia.org>
Sat, 15 Sep 2012 21:51:58 +0000 (14:51 -0700)
committerTim Starling <tstarling@wikimedia.org>
Sat, 15 Sep 2012 21:51:58 +0000 (14:51 -0700)
commit2caa7829fcc6a0ab45f91c4346c0d5a9100ef4dc
treec1cabc6e651381c8c9272239f5079281f145705b
parent3f090da982d09cb814dfda265881091cc4ba5c45
Generated node count limit

To prevent large template DOM caches from sending servers into swap,
throw an exception when more than some number of DOM elements are
parsed. Unfortunately, it wasn't possible to return a normal error
message, because it broke PST and extractSections and corrupted the
article text. It's safer to refuse to save the edit, and we don't
have decent ways to do that short of throwing an exception.

Ideally we would like to have an upstream patch that hooks libxml to
allocate memory from PHP's request pool, then a fatal error would be
raised instead of swapping.

Change-Id: I4cb4f6fd313e1e0940b56cc5e586afd1bea9267a
includes/DefaultSettings.php
includes/parser/Parser.php
includes/parser/ParserOptions.php
includes/parser/Preprocessor_DOM.php