r19935 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r19934 | r19935 (on ViewVC) | r19936 >
Date:01:24, 15 February 2007
Author:daniel
Status:new
Tags:
Comment:Bug 8824: check read permission when exporting
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/SpecialExport.php
===================================================================
--- trunk/phase3/includes/SpecialExport.php	(revision 19934)
+++ trunk/phase3/includes/SpecialExport.php	(revision 19935)
@@ -104,7 +104,13 @@
 					}
 				}
 			}*/
-			$exporter->pageByName( $page );
+
+			#Bug 8824: Only export pages the user can read
+			$title = Title::newFromText( $page );
+			if( is_null( $title ) ) continue; #TODO: perhaps output an <error> tag or something.
+			if( !$title->userCan( 'read' ) ) continue; #TODO: perhaps output an <error> tag or something.
+
+			$exporter->pageByTitle( $title );
 		}
 		
 		$exporter->closeStream();
Views
Toolbox