mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 20:09:44 +00:00
cr
This commit is contained in:
parent
7ad0c01c19
commit
808026dae1
|
@ -51,17 +51,21 @@ class XmlParser {
|
||||||
*/
|
*/
|
||||||
public function getDataFromXmlString( $xmlString ) {
|
public function getDataFromXmlString( $xmlString ) {
|
||||||
wfProfileIn( __METHOD__ );
|
wfProfileIn( __METHOD__ );
|
||||||
|
$global_libxml_setting = libxml_use_internal_errors();
|
||||||
libxml_use_internal_errors( true );
|
libxml_use_internal_errors( true );
|
||||||
$xml = simplexml_load_string( $xmlString );
|
$xml = simplexml_load_string( $xmlString );
|
||||||
if ( $xml === false ) {
|
if ( $xml === false ) {
|
||||||
$errors = libxml_get_errors();
|
$errors = libxml_get_errors();
|
||||||
foreach ( $errors as $xmlerror ) {
|
foreach ( $errors as $xmlerror ) {
|
||||||
\Wikia\Logger\WikiaLogger::instance()->debug( "PortableInfobox XML Parser problem", [
|
if ( $xmlerror->level >= LIBXML_ERR_ERROR ) {
|
||||||
"level" => $xmlerror->level,
|
\Wikia\Logger\WikiaLogger::instance()->debug( "PortableInfobox XML Parser problem", [
|
||||||
"code" => $xmlerror->code,
|
"level" => $xmlerror->level,
|
||||||
"message" => $xmlerror->message ] );
|
"code" => $xmlerror->code,
|
||||||
|
"message" => $xmlerror->message ] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
|
libxml_use_internal_errors( $global_libxml_setting );
|
||||||
throw new XmlMarkupParseErrorException();
|
throw new XmlMarkupParseErrorException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue