Bug 8824: check read permission when exporting
authorDaniel Kinzler <daniel@users.mediawiki.org>
Thu, 15 Feb 2007 01:24:33 +0000 (01:24 +0000)
committerDaniel Kinzler <daniel@users.mediawiki.org>
Thu, 15 Feb 2007 01:24:33 +0000 (01:24 +0000)
includes/SpecialExport.php

index 27e81b4..610f627 100644 (file)
@@ -104,7 +104,13 @@ function wfSpecialExport( $page = '' ) {
                                        }
                                }
                        }*/
-                       $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();