Use HHVM+EZC internal tidy
authorTim Starling <tstarling@wikimedia.org>
Wed, 26 Nov 2014 03:01:13 +0000 (14:01 +1100)
committerTim Starling <tstarling@wikimedia.org>
Thu, 27 Nov 2014 22:47:25 +0000 (09:47 +1100)
commite6fdbfec472ec12655805089492e51bf6d29f86e
tree9f29fe5c9ba0039e3c31709aa0ce2f94c7c32faa
parenta3fe441bf69f9e3cae6155b07f710ad21a1c6552
Use HHVM+EZC internal tidy

EZC doesn't currently support direct access to object properties via the
obj->std.properties hashtable, but tidy uses this extensively. But it
turns out that for production use cases, tidy_repair_string() should be
sufficient. $wgDebugTidy and $wgValidateAllHtml are not used, and
no deployed extension calls MWTidy::checkErrors().

The only difference I know of is that errors from tidy (status==2) lead
to the tidy output being used, rather than discarded. But
TY_(ReportFatal) has very few callers in tidylib -- probably none that
are reachable from stripped parser output.

So, throw an exception if MWTidy::checkErrors() is requested on an HHVM
instance with the tidy extension. For MWTidy::tidy(), use
tidy_repair_string(). Refactor some relevant code.

Bug: T758
Change-Id: I8d5b1c2c9f9ddce46d8ad099a671a2e297d256e0
includes/parser/MWTidy.php