From: Aaron Schulz Date: Mon, 6 Oct 2008 23:51:33 +0000 (+0000) Subject: (bug 9226) Fetch restrictions properly on export X-Git-Tag: 1.31.0-rc.0~44861 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a7f73ffad0ef31621706b5023a929ea40f8a13fd;p=lhc%2Fweb%2Fwiklou.git (bug 9226) Fetch restrictions properly on export --- diff --git a/includes/Export.php b/includes/Export.php index 827561e7e9..72e8f1e5c9 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -425,13 +425,20 @@ class XmlDumpWriter { * @access private */ function openPage( $row ) { + global $wgRestrictionTypes; $out = " \n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $out .= ' ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n"; $out .= ' ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n"; - if( '' != $row->page_restrictions ) { - $out .= ' ' . wfElement( 'restrictions', array(), - strval( $row->page_restrictions ) ) . "\n"; + # Get page restrictions + $restrictions = array(); + foreach( $wgRestrictionTypes as $action ) { + $restrictions[$action] = implode( '', $title->getRestrictions( $action ) ); + } + $restrictions = Article::flattenRestrictions( $restrictions ); + if( '' != $restrictions ) { + $out .= ' ' . wfElement( 'restrictions', array(), + strval( $restrictions ) ) . "\n"; } return $out; }