wfProfileOut( __METHOD__ );
return;
}
- if ( !$this->mTitle->getArticleId() )
+ if ( !$this->mTitle->getArticleID() )
wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
else
wfRunHooks( 'EditFormInitialText', array( $this ) );
# Otherwise, $text will be left as-is.
if ( !is_null( $undorev ) && !is_null( $oldrev ) &&
$undorev->getPage() == $oldrev->getPage() &&
- $undorev->getPage() == $this->mTitle->getArticleId() &&
+ $undorev->getPage() == $this->mTitle->getArticleID() &&
!$undorev->isDeleted( Revision::DELETED_TEXT ) &&
!$oldrev->isDeleted( Revision::DELETED_TEXT ) ) {
$undoMsg = 'norev';
}
- $this->editFormPageTop .= $wgOut->parse( "<div class=\"error mw-undo-{$undoMsg}\">" .
+ $class = ( $undoMsg == 'success' ? '' : 'error ' ) . "mw-undo-{$undoMsg}";
+ $this->editFormPageTop .= $wgOut->parse( "<div class=\"{$class}\">" .
wfMsgNoTrans( 'undo-' . $undoMsg ) . '</div>', true, /* interface */true );
}
global $wgUser;
if ( $this->watchthis xor $this->mTitle->userIsWatching() ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->begin();
+ $dbw->begin( __METHOD__ );
if ( $this->watchthis ) {
WatchAction::doWatch( $this->mTitle, $wgUser );
} else {
WatchAction::doUnwatch( $this->mTitle, $wgUser );
}
- $dbw->commit();
+ $dbw->commit( __METHOD__ );
}
}
$res = $dbw->select( 'revision',
'rev_user',
array(
- 'rev_page' => $this->mTitle->getArticleId(),
+ 'rev_page' => $this->mTitle->getArticleID(),
'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $edittime ) )
),
__METHOD__,
* @return Mixed|string or false
*/
public static function extractSectionTitle( $text ) {
- preg_match( "/^(=+)(.+)\\1(\n|$)/i", $text, $matches );
+ preg_match( "/^(=+)(.+)\\1\\s*(\n|$)/i", $text, $matches );
if ( !empty( $matches[2] ) ) {
global $wgParser;
return $wgParser->stripSectionName( trim( $matches[2] ) );
function showDiff() {
global $wgUser, $wgContLang, $wgParser, $wgOut;
- $oldtext = $this->getOriginalContent();
+ $oldtext = $this->mArticle->getRawText();
$newtext = $this->mArticle->replaceSection(
$this->section, $this->textbox1, $this->summary, $this->edittime );
$wgOut->addHTML( '</div>' );
$wgOut->wrapWikiMsg( '<h2>$1</h2>', "yourdiff" );
- $de = new DifferenceEngine( $this->mArticle->getContext() );
- $de->setText( $this->getCurrentText(), $this->textbox2 );
- $de->showDiff( wfMsg( "storedversion" ), wfMsgExt( 'yourtext', 'parseinline' ) );
+ $this->showDiff();
$wgOut->wrapWikiMsg( '<h2>$1</h2>', "yourtext" );
$this->showTextbox2();