]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - includes/Import.php
MediaWiki 1.15.0
[autoinstalls/mediawiki.git] / includes / Import.php
index 56e7a7fb961e87b2381730ee5977b5418455aa45..973866df227dde733203556f250d0a0b274dc9aa 100644 (file)
@@ -223,7 +223,7 @@ class WikiRevision {
 
                } elseif( $changed ) {
                        wfDebug( __METHOD__ . ": running onArticleEdit\n" );
-                       Article::onArticleEdit( $this->title, 'skiptransclusions' ); // leave templatelinks for editUpdates()
+                       Article::onArticleEdit( $this->title );
 
                        wfDebug( __METHOD__ . ": running edit updates\n" );
                        $article->editUpdates(
@@ -1116,7 +1116,7 @@ class ImportStreamSource {
                }
        }
 
-       public static function newFromInterwiki( $interwiki, $page, $history=false ) {
+       public static function newFromInterwiki( $interwiki, $page, $history = false, $templates = false, $pageLinkDepth = 0 ) {
                if( $page == '' ) {
                        return new WikiErrorMsg( 'import-noarticle' );
                }
@@ -1124,7 +1124,10 @@ class ImportStreamSource {
                if( is_null( $link ) || $link->getInterwiki() == '' ) {
                        return new WikiErrorMsg( 'importbadinterwiki' );
                } else {
-                       $params = $history ? 'history=1' : '';
+                       $params = array();
+                       if ( $history ) $params['history'] = 1;
+                       if ( $templates ) $params['templates'] = 1;
+                       if ( $pageLinkDepth ) $params['pagelink-depth'] = $pageLinkDepth;
                        $url = $link->getFullUrl( $params );
                        # For interwikis, use POST to avoid redirects.
                        return ImportStreamSource::newFromURL( $url, "POST" );