LocalisationCache: Use file_get_contents instead of DOMDocument::load
DOMDocument::load fails to load the plurals data during the import process. This is a work-around for https://bugs.php.net/bug.php?id=64938. This bug only rears its head when using Special:Import, because that is essentially the only place in MediaWiki where we fiddle with libxml_disable_entity_loader. Bug: T58439 Change-Id: Idcb4ab1cef2a7b080543e7cc1cee5464fc476456
This commit is contained in:
parent
582adf6d19
commit
c139126841
1 changed files with 6 additions and 1 deletions
7
includes/cache/LocalisationCache.php
vendored
7
includes/cache/LocalisationCache.php
vendored
|
|
@ -656,8 +656,13 @@ class LocalisationCache {
|
|||
* @param string $fileName
|
||||
*/
|
||||
protected function loadPluralFile( $fileName ) {
|
||||
// Use file_get_contents instead of DOMDocument::load (T58439)
|
||||
$xml = file_get_contents( $fileName );
|
||||
if ( !$xml ) {
|
||||
throw new MWException( "Unable to read plurals file $fileName" );
|
||||
}
|
||||
$doc = new DOMDocument;
|
||||
$doc->load( $fileName );
|
||||
$doc->loadXML( $xml );
|
||||
$rulesets = $doc->getElementsByTagName( "pluralRules" );
|
||||
foreach ( $rulesets as $ruleset ) {
|
||||
$codes = $ruleset->getAttribute( 'locales' );
|
||||
|
|
|
|||
Loading…
Reference in a new issue