r53521 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53520‎ | r53521 | r53522 >
Date:02:47, 20 July 2009
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 17374) Special:Export no longer exports multiple copies of pages
Proper normalization now! Only keeps one copy of each normalized page title; also now discarding interwikis explicitly.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -191,10 +191,22 @@
192192 private function doExport( $page, $history, $list_authors ) {
193193 global $wgExportMaxHistory;
194194
195 - /* Split up the input and look up linked pages */
196 - $inputPages = array_filter( explode( "\n", $page ), array( $this, 'filterPage' ) );
197 - $pageSet = array_flip( $inputPages );
 195+ $pageSet = array(); // Inverted index of all pages to look up
198196
 197+ // Split up and normalize input
 198+ foreach( explode( "\n", $page ) as $pageName ) {
 199+ $pageName = trim( $pageName );
 200+ $title = Title::newFromText( $pageName );
 201+ if( $title && $title->getInterwiki() == '' && $title->getText() != '' ) {
 202+ // Only record each page once!
 203+ $pageSet[$title->getPrefixedText()] = true;
 204+ }
 205+ }
 206+
 207+ // Set of original pages to pass on to further manipulation...
 208+ $inputPages = array_keys( $pageSet );
 209+
 210+ // Look up any linked pages if asked...
199211 if( $this->templates ) {
200212 $pageSet = $this->getTemplates( $inputPages, $pageSet );
201213 }
Index: trunk/phase3/RELEASE-NOTES
@@ -301,6 +301,7 @@
302302 * (bug 17139) ts_resortTable inconsistent trimming makes date sorting fragile
303303 * (bug 19445) Change oldimage table to use ON UPDATE CASCADE for FK to image table.
304304 * (bug 14080) Short notation links to subpages didn't work in edit summaries
 305+* (bug 17374) Special:Export no longer exports multiple copies of pages
305306
306307 == API changes in 1.16 ==
307308

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r48938(bug 17374) Special:Export no longer exports two copies of the same pagedemon22:01, 27 March 2009

Comments

#Comment by 😂 (talk | contribs)   13:27, 20 July 2009

r53521 is marked fixme, guessing this resolves that?

#Comment by 😂 (talk | contribs)   11:49, 23 July 2009

And by that I meant r48938.

Status & tagging log