From: Rotem Liss Date: Sun, 27 Jan 2008 17:18:03 +0000 (+0000) Subject: Fix for Special:Export so it doesn't ignore the page named '0'. X-Git-Tag: 1.31.0-rc.0~49759 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=66174ccf9811891a7bbbbb1a95b3d7b21bef1691;p=lhc%2Fweb%2Fwiklou.git Fix for Special:Export so it doesn't ignore the page named '0'. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9632b9c522..e1ef5875d7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index a3a7649b4e..99d9958fec 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -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' ) ) {