replace TYPE= with ENGINE=, (supported since 4.0, TYPE deprecated since 4.1)
[lhc/web/wiklou.git] / includes / EditPage.php
index 46d9e8d..480533c 100644 (file)
@@ -26,6 +26,7 @@ class EditPage {
        var $mTokenOk = true;
        var $tooBig = false;
        var $kblength = false;
+       var $missingComment = false;
 
        # Form values
        var $save = false, $preview = false, $diff = false;
@@ -155,8 +156,8 @@ class EditPage {
         * the newly-edited page.
         */
        function edit() {
-               global $wgOut, $wgUser, $wgRequest, $wgTitle,
-                      $wgEmailConfirmToEdit;
+               global $wgOut, $wgUser, $wgRequest, $wgTitle;
+               global $wgEmailConfirmToEdit;
 
                if ( ! wfRunHooks( 'AlternateEdit', array( &$this  ) ) )
                        return;
@@ -630,6 +631,10 @@ class EditPage {
                wfProfileIn( "$fname-sectionanchor" );
                $sectionanchor = '';
                if( $this->section == 'new' ) {
+                       if ( $this->textbox1 == '' ) {
+                               $this->missingComment = true;
+                               return true;
+                       }
                        if( $this->summary != '' ) {
                                $sectionanchor = $this->sectionAnchor( $this->summary );
                        }
@@ -735,6 +740,11 @@ class EditPage {
                                $s = wfMsg( 'editing', $this->mTitle->getPrefixedText() );
                        }
                        $wgOut->setPageTitle( $s );
+
+                       if ( $this->missingComment ) {
+                               $wgOut->addWikiText( wfMsg( 'missingcommenttext' ) );
+                       }
+
                        if ( !$this->checkUnicodeCompliantBrowser() ) {
                                $wgOut->addWikiText( wfMsg( 'nonunicodebrowser') );
                        }
@@ -1208,7 +1218,7 @@ END
                        } else if(preg_match("/\\.js$/", $wgTitle->getText() ) ) {
                                $previewtext = wfMsg('userjspreview');
                        }
-                        $parserOptions->setTidy(true);
+                       $parserOptions->setTidy(true);
                        $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
                        $wgOut->addHTML( $parserOutput->mText );
                        wfProfileOut( $fname );
@@ -1228,7 +1238,7 @@ END
                        }
 
                        if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
-                        $parserOptions->setTidy(true);
+                       $parserOptions->setTidy(true);
                        $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
                                        $wgTitle, $parserOptions );
 
@@ -1535,8 +1545,6 @@ END
         * @return string HTML
         */
        function getDiff() {
-               global $wgUser;
-
                require_once( 'DifferenceEngine.php' );
                $oldtext = $this->mArticle->fetchContent();
                $newtext = $this->mArticle->replaceSection(