var $mTokenOk = true;
var $tooBig = false;
var $kblength = false;
+ var $missingComment = false;
# Form values
var $save = false, $preview = false, $diff = false;
* 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;
wfProfileIn( "$fname-sectionanchor" );
$sectionanchor = '';
if( $this->section == 'new' ) {
+ if ( $this->textbox1 == '' ) {
+ $this->missingComment = true;
+ return true;
+ }
if( $this->summary != '' ) {
$sectionanchor = $this->sectionAnchor( $this->summary );
}
$s = wfMsg( 'editing', $this->mTitle->getPrefixedText() );
}
$wgOut->setPageTitle( $s );
+
+ if ( $this->missingComment ) {
+ $wgOut->addWikiText( wfMsg( 'missingcommenttext' ) );
+ }
+
if ( !$this->checkUnicodeCompliantBrowser() ) {
$wgOut->addWikiText( wfMsg( 'nonunicodebrowser') );
}
} 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 );
}
if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
- $parserOptions->setTidy(true);
+ $parserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
$wgTitle, $parserOptions );
* @return string HTML
*/
function getDiff() {
- global $wgUser;
-
require_once( 'DifferenceEngine.php' );
$oldtext = $this->mArticle->fetchContent();
$newtext = $this->mArticle->replaceSection(