diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/media/XMP.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/media/XMP.php')
-rw-r--r-- | includes/media/XMP.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/media/XMP.php b/includes/media/XMP.php index a3f45e6c..50f04ae9 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -195,7 +195,7 @@ class XMPReader { $data = $this->results; - wfRunHooks( 'XMPGetResults', array( &$data ) ); + Hooks::run( 'XMPGetResults', array( &$data ) ); if ( isset( $data['xmp-special']['AuthorsPosition'] ) && is_string( $data['xmp-special']['AuthorsPosition'] ) @@ -331,7 +331,7 @@ class XMPReader { // could declare entities unsafe to parse with xml_parse (T85848/T71210). if ( $this->parsable !== self::PARSABLE_OK ) { if ( $this->parsable === self::PARSABLE_NO ) { - throw new MWException( 'Unsafe doctype declaration in XML.' ); + throw new Exception( 'Unsafe doctype declaration in XML.' ); } $content = $this->xmlParsableBuffer . $content; @@ -344,7 +344,7 @@ class XMPReader { $msg = ( $this->parsable === self::PARSABLE_NO ) ? 'Unsafe doctype declaration in XML.' : 'No root element found in XML.'; - throw new MWException( $msg ); + throw new Exception( $msg ); } } @@ -359,7 +359,7 @@ class XMPReader { $this->results = array(); // blank if error. return false; } - } catch ( MWException $e ) { + } catch ( Exception $e ) { wfDebugLog( 'XMP', 'XMP parse error: ' . $e ); $this->results = array(); @@ -501,6 +501,10 @@ class XMPReader { ); $oldDisable = libxml_disable_entity_loader( true ); + $reset = new ScopedCallback( + 'libxml_disable_entity_loader', + array( $oldDisable ) + ); $reader->setParserProperty( XMLReader::SUBST_ENTITIES, false ); // Even with LIBXML_NOWARNING set, XMLReader::read gives a warning @@ -520,7 +524,6 @@ class XMPReader { } } wfRestoreWarnings(); - libxml_disable_entity_loader( $oldDisable ); if ( !is_null( $result ) ) { return $result; |