Fix for Special:Export so it doesn't ignore the page named '0'.
authorRotem Liss <rotem@users.mediawiki.org>
Sun, 27 Jan 2008 17:18:03 +0000 (17:18 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Sun, 27 Jan 2008 17:18:03 +0000 (17:18 +0000)
RELEASE-NOTES
includes/SpecialExport.php

index 9632b9c..e1ef587 100644 (file)
@@ -340,6 +340,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12753) Empty captions in MediaWiki:Sidebar result in PHP errors
 * (bug 12790) Page protection is not logged when edit-protection is used and move-protection is not
 * (bug 12793) Fix for restricted namespaces/pages in Special:Export
+* Fix for Special:Export so it doesn't ignore the page named '0'
 
 
 == Parser changes in 1.12 ==
index a3a7649..99d9958 100644 (file)
@@ -104,6 +104,13 @@ function wfExportGetLinks( $inputPages, $pageSet, $table, $fields, $join ) {
        return $pageSet;
 }
 
+/**
+ * Callback function to remove empty strings from the pages array.
+ */
+function wfFilterPage( $page ) {
+       return $page !== '' && $page !== null;
+}
+
 /**
  *
  */
@@ -198,7 +205,7 @@ function wfSpecialExport( $page = '' ) {
                }
                
                /* Split up the input and look up linked pages */
-               $inputPages = array_filter( explode( "\n", $page ) );
+               $inputPages = array_filter( explode( "\n", $page ), 'wfFilterPage' );
                $pageSet = array_flip( $inputPages );
 
                if( $wgRequest->getCheck( 'templates' ) ) {