Merge "libxml_disable_entity_loader() just in case..."
[lhc/web/wiklou.git] / includes / Import.php
index 8220287..8b7af02 100644 (file)
@@ -381,7 +381,7 @@ class WikiImporter {
                }
                $buffer = "";
                while ( $this->reader->read() ) {
-                       switch( $this->reader->nodeType ) {
+                       switch ( $this->reader->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->reader->value;
@@ -424,15 +424,15 @@ class WikiImporter {
                        $lookup = array();
 
                        foreach ( $xmlReaderConstants as $name ) {
-                               $lookup[constant("XmlReader::$name")] = $name;
+                               $lookup[constant( "XmlReader::$name" )] = $name;
                        }
                }
 
-               print( var_dump(
+               print var_dump(
                        $lookup[$this->reader->nodeType],
                        $this->reader->name,
                        $this->reader->value
-               ) . "\n\n" );
+               ) . "\n\n";
        }
 
        /**
@@ -463,7 +463,7 @@ class WikiImporter {
                        $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;
@@ -522,8 +522,9 @@ class WikiImporter {
 
                        $tag = $this->reader->name;
 
-                       if ( !wfRunHooks( 'ImportHandleLogItemXMLTag',
-                                               $this, $logInfo ) ) {
+                       if ( !wfRunHooks( 'ImportHandleLogItemXMLTag', array(
+                               $this, $logInfo
+                       ) ) ) {
                                // Do nothing
                        } elseif ( in_array( $tag, $normalFields ) ) {
                                $logInfo[$tag] = $this->nodeContents();
@@ -639,8 +640,9 @@ class WikiImporter {
 
                        $tag = $this->reader->name;
 
-                       if ( !wfRunHooks( 'ImportHandleRevisionXMLTag', $this,
-                                               $pageInfo, $revisionInfo ) ) {
+                       if ( !wfRunHooks( 'ImportHandleRevisionXMLTag', array(
+                               $this, $pageInfo, $revisionInfo
+                       ) ) ) {
                                // Do nothing
                        } elseif ( in_array( $tag, $normalFields ) ) {
                                $revisionInfo[$tag] = $this->nodeContents();
@@ -725,8 +727,9 @@ class WikiImporter {
 
                        $tag = $this->reader->name;
 
-                       if ( !wfRunHooks( 'ImportHandleUploadXMLTag', $this,
-                                               $pageInfo ) ) {
+                       if ( !wfRunHooks( 'ImportHandleUploadXMLTag', array(
+                               $this, $pageInfo
+                       ) ) ) {
                                // Do nothing
                        } elseif ( in_array( $tag, $normalFields ) ) {
                                $uploadInfo[$tag] = $this->nodeContents();
@@ -1002,7 +1005,7 @@ class XMLReader2 extends XMLReader {
                }
                $buffer = "";
                while ( $this->read() ) {
-                       switch( $this->nodeType ) {
+                       switch ( $this->nodeType ) {
                        case XmlReader::TEXT:
                        case XmlReader::SIGNIFICANT_WHITESPACE:
                                $buffer .= $this->value;
@@ -1657,7 +1660,7 @@ class ImportStreamSource {
                        return Status::newFatal( 'importnofile' );
                }
                if ( !empty( $upload['error'] ) ) {
-                       switch( $upload['error'] ) {
+                       switch ( $upload['error'] ) {
                                case 1: # The uploaded file exceeds the upload_max_filesize directive in php.ini.
                                        return Status::newFatal( 'importuploaderrorsize' );
                                case 2: # The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.