Fix PHP Notice: Undefined variable: text in /var/www/w/includes/Export.php on line...
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 15 Oct 2009 07:08:56 +0000 (07:08 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 15 Oct 2009 07:08:56 +0000 (07:08 +0000)
Initialize $text to avoid this notice.
But I am unsure if this is enough. The variable $text seems unused for a long time until a hook, introduced in r53818, uses it.

includes/Export.php

index dd58d4b..61847ac 100644 (file)
@@ -500,6 +500,7 @@ class XmlDumpWriter {
                        $out .= "      " . Xml::elementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n";
                }
 
+               $text = '';
                if( $row->rev_deleted & Revision::DELETED_TEXT ) {
                        $out .= "      " . Xml::element( 'text', array( 'deleted' => 'deleted' ) ) . "\n";
                } elseif( isset( $row->old_text ) ) {
@@ -514,7 +515,7 @@ class XmlDumpWriter {
                                array( 'id' => $row->rev_text_id ),
                                "" ) . "\n";
                }
-               
+
                wfRunHooks( 'XmlDumpWriterWriteRevision', array( &$this, &$out, $row, $text ) );
 
                $out .= "    </revision>\n";