From a7f73ffad0ef31621706b5023a929ea40f8a13fd Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 6 Oct 2008 23:51:33 +0000 Subject: [PATCH] (bug 9226) Fetch restrictions properly on export --- includes/Export.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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; } -- 2.20.1