Page MenuHomePhabricator

Support for Tidy PECL extension is broken for PHP 5
Closed, ResolvedPublic

Description

Author: michaeldaly

Description:
Changes to Parser.php for version neutral internalTidy($text)

Parser.php doesn't work with PHP5.x

Rather than force users to make changes, just change code to be version aware and use appropriate function calls.

I've made some changes and attached a diff as a patch (I hope that's the right way to do this).

I tested it with PHP5.2 but not PHP4.x. Could someone test with PHP4.x and consider this for fixing this problem.


Version: 1.10.x
Severity: minor

Attached:

Details

Reference
bz9972

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:38 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz9972.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Note that PHP 4 has not been supported for over a year, since 1.7. Code to support it is unnecessary and will not be added.

michaeldaly wrote:

Parser patch with only PHP5 code - tested w/ MW1.10

I redid the code for function internalTidy($text) to remove the PHP 4 code and only have PHP 5 support. Smaller and simpler.

Attached:

jkinard wrote:

Hah, I just ran into this when trying to get MW 1.11 to play nice on a NetWare box using the PHP5 Tidy and Apache's mod_tidy.nlm lib (because there isn't a native external tidy for NetWare), and had to mod Parser.php to use the PHP5 variants. My patch came out almost the exact same as yours, except for $tidy->getStatus.

Anywho, if PHP4 hasn't been supported since 1.7, then I think it'd be nice to get this into the queue for 1.12 (or a 1.11 point release), since it'll help solve problems for those starting up new installs.

I'm also marking another bug related to this as a dupe of this bug, since this actually contains a fix.

Cheers!

jkinard wrote:

*** Bug 6475 has been marked as a duplicate of this bug. ***

michaeldaly wrote:

I don't suppose anyone's ever going to apply that patch to the trunk? If the bad code's in Parser.php and it's a minor change, it should be fixed.

Code in trunk (for 1.12) appears to have already replaced the old calls with newer ones using the object interface. Guess this is fixed as of r27667...