Index: branches/phase3_rev_deleted/includes/SpecialImport.php |
— | — | @@ -328,10 +328,12 @@ |
329 | 329 | } else { |
330 | 330 | $created = false; |
331 | 331 | |
332 | | - $latest = $dbw->selectField( 'revision', 'MAX(rev_timestamp)', |
| 332 | + $result = $dbw->select( 'revision', |
| 333 | + array('MIN(rev_timestamp) as created', 'MAX(rev_timestamp) as latest'), |
333 | 334 | array( 'rev_page' => $pageId ), __METHOD__ ); |
| 335 | + $row = $dbw->fetchObject($result); |
334 | 336 | // Don't make fucked up alternating page histories |
335 | | - if( $latest && $latest > $this->timestamp ) { |
| 337 | + if( $row && $row->latest > $this->timestamp && $row->created < $this->timestamp ) { |
336 | 338 | wfDebug( __METHOD__ . ": skipping existing revision for [[" . |
337 | 339 | $this->title->getPrefixedText() . "]], timestamp " . |
338 | 340 | $this->timestamp . "\n" ); |
— | — | @@ -858,13 +860,13 @@ |
859 | 861 | } |
860 | 862 | } |
861 | 863 | |
862 | | - function newFromURL( $url, $method = 'GET' ) { |
| 864 | + function newFromURL( $url ) { |
863 | 865 | wfDebug( __METHOD__ . ": opening $url\n" ); |
864 | 866 | # Use the standard HTTP fetch function; it times out |
865 | 867 | # quicker and sorts out user-agent problems which might |
866 | 868 | # otherwise prevent importing from large sites, such |
867 | 869 | # as the Wikimedia cluster, etc. |
868 | | - $data = Http::request( $method, $url ); |
| 870 | + $data = Http::get( $url ); |
869 | 871 | if( $data !== false ) { |
870 | 872 | $file = tmpfile(); |
871 | 873 | fwrite( $file, $data ); |
— | — | @@ -883,8 +885,7 @@ |
884 | 886 | } else { |
885 | 887 | $params = $history ? 'history=1' : ''; |
886 | 888 | $url = $link->getFullUrl( $params ); |
887 | | - # For interwikis, use POST to avoid redirects. |
888 | | - return ImportStreamSource::newFromURL( $url, "POST" ); |
| 889 | + return ImportStreamSource::newFromURL( $url ); |
889 | 890 | } |
890 | 891 | } |
891 | 892 | } |
Index: branches/phase3_rev_deleted/includes/LinksUpdate.php |
— | — | @@ -76,6 +76,7 @@ |
77 | 77 | } else { |
78 | 78 | $this->doIncrementalUpdate(); |
79 | 79 | } |
| 80 | + wfRunHooks( 'TitleLinkUpdatesAfterCompletion', array( &$this->mTitle ) ); |
80 | 81 | } |
81 | 82 | |
82 | 83 | function doIncrementalUpdate() { |