return $text;
}
- /**
- * @deprecated since 1.7 use Article::doEdit()
- */
- function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) {
- wfDeprecated( __METHOD__ );
-
- $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
- ( $isminor ? EDIT_MINOR : 0 ) |
- ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ) |
- ( $bot ? EDIT_FORCE_BOT : 0 );
-
- # If this is a comment, add the summary as headline
- if ( $comment && $summary != "" ) {
- $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $summary ) . "\n\n" . $text;
- }
- $this->doEdit( $text, $summary, $flags );
-
- $dbw = wfGetDB( DB_MASTER );
- if ( $watchthis ) {
- if ( !$this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doWatch();
- $dbw->commit();
- }
- } else {
- if ( $this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doUnwatch();
- $dbw->commit();
- }
- }
- $this->doRedirect( $this->isRedirect( $text ) );
- }
-
- /**
- * @deprecated since 1.7 use Article::doEdit()
- */
- function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
- wfDeprecated( __METHOD__ );
-
- $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
- ( $minor ? EDIT_MINOR : 0 ) |
- ( $forceBot ? EDIT_FORCE_BOT : 0 );
-
- $status = $this->doEdit( $text, $summary, $flags );
-
- if ( !$status->isOK() ) {
- return false;
- }
-
- $dbw = wfGetDB( DB_MASTER );
- if ( $watchthis ) {
- if ( !$this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doWatch();
- $dbw->commit();
- }
- } else {
- if ( $this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doUnwatch();
- $dbw->commit();
- }
- }
-
- $extraQuery = ''; // Give extensions a chance to modify URL query on update
- wfRunHooks( 'ArticleUpdateBeforeRedirect', array( $this, &$sectionanchor, &$extraQuery ) );
-
- $this->doRedirect( $this->isRedirect( $text ), $sectionanchor, $extraQuery );
- return true;
- }
-
/**
* Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed.
* @param $flags Int