Stop PHP notices fouling up XML, when exporting all pages
authorChristian Aistleitner <christian@quelltextlich.at>
Fri, 30 Mar 2012 21:01:06 +0000 (23:01 +0200)
committerChristian Aistleitner <christian@quelltextlich.at>
Fri, 30 Mar 2012 21:01:12 +0000 (23:01 +0200)
Change-Id: I330fd34daeb2ad82d8d8a63b0ef2cb11f52f1170

includes/specials/SpecialExport.php

index 360d2d2..b00eec8 100644 (file)
@@ -93,6 +93,13 @@ class SpecialExport extends SpecialPage {
                elseif( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
                        $this->doExport = true;
                        $exportall = true;
+
+                       /* Although $page and $history are not used later on, we
+                       nevertheless set them to avoid that PHP notices about using
+                       undefined variables foul up our XML output (see call to
+                       doExport(...) further down) */
+                       $page = '';
+                       $history = '';
                }
                elseif( $request->wasPosted() && $par == '' ) {
                        $page = $request->getText( 'pages' );