MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/61064


Change subject: Fix XML import
......................................................................

Fix XML import

af125df5199b5c232bf335d735cecc6d8f8e9784 broke importing because Import.php
was calling wfRunHooks() improperly. Fixing the call as well as relaxing the 
type check
for now because who knows how many callers are quietly (and harmlessly) broken.

Change-Id: If44292fedf6917cde1dae7f0391231a18d414610
---
M includes/Hooks.php
M includes/Import.php
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/61064/1

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 5d8a4a7..2cf49e5 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -129,8 +129,9 @@
         * @throws MWException
         * @throws FatalError
         */
-       public static function run( $event, array $args = array() ) {
+       public static function run( $event, $args = array() ) {
                wfProfileIn( 'hook: ' . $event );
+               $args = (array)$args;
                foreach ( self::getHandlers( $event ) as $hook ) {
                        // Turn non-array values into an array. (Can't use 
casting because of objects.)
                        if ( !is_array( $hook ) ) {
diff --git a/includes/Import.php b/includes/Import.php
index bf5a3fb..6c9433a 100644
--- a/includes/Import.php
+++ b/includes/Import.php
@@ -463,7 +463,7 @@
                        $tag = $this->reader->name;
                        $type = $this->reader->nodeType;
 
-                       if ( !wfRunHooks( 'ImportHandleToplevelXMLTag', $this ) 
) {
+                       if ( !wfRunHooks( 'ImportHandleToplevelXMLTag', array( 
$this ) ) ) {
                                // Do nothing
                        } elseif ( $tag == 'mediawiki' && $type == 
XmlReader::END_ELEMENT ) {
                                break;

-- 
To view, visit https://gerrit.wikimedia.org/r/61064
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If44292fedf6917cde1dae7f0391231a18d414610
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to