* usually the same, but they are now allowed to be different.
*/
class EditPage {
- const AS_SUCCESS_UPDATE = 200;
- const AS_SUCCESS_NEW_ARTICLE = 201;
- const AS_HOOK_ERROR = 210;
- const AS_FILTERING = 211;
- const AS_HOOK_ERROR_EXPECTED = 212;
- const AS_BLOCKED_PAGE_FOR_USER = 215;
- const AS_CONTENT_TOO_BIG = 216;
- const AS_USER_CANNOT_EDIT = 217;
- const AS_READ_ONLY_PAGE_ANON = 218;
- const AS_READ_ONLY_PAGE_LOGGED = 219;
- const AS_READ_ONLY_PAGE = 220;
- const AS_RATE_LIMITED = 221;
- const AS_ARTICLE_WAS_DELETED = 222;
- const AS_NO_CREATE_PERMISSION = 223;
- const AS_BLANK_ARTICLE = 224;
- const AS_CONFLICT_DETECTED = 225;
- const AS_SUMMARY_NEEDED = 226;
- const AS_TEXTBOX_EMPTY = 228;
+ const AS_SUCCESS_UPDATE = 200;
+ const AS_SUCCESS_NEW_ARTICLE = 201;
+ const AS_HOOK_ERROR = 210;
+ const AS_FILTERING = 211;
+ const AS_HOOK_ERROR_EXPECTED = 212;
+ const AS_BLOCKED_PAGE_FOR_USER = 215;
+ const AS_CONTENT_TOO_BIG = 216;
+ const AS_USER_CANNOT_EDIT = 217;
+ const AS_READ_ONLY_PAGE_ANON = 218;
+ const AS_READ_ONLY_PAGE_LOGGED = 219;
+ const AS_READ_ONLY_PAGE = 220;
+ const AS_RATE_LIMITED = 221;
+ const AS_ARTICLE_WAS_DELETED = 222;
+ const AS_NO_CREATE_PERMISSION = 223;
+ const AS_BLANK_ARTICLE = 224;
+ const AS_CONFLICT_DETECTED = 225;
+ const AS_SUMMARY_NEEDED = 226;
+ const AS_TEXTBOX_EMPTY = 228;
const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229;
- const AS_OK = 230;
- const AS_END = 231;
- const AS_SPAM_ERROR = 232;
- const AS_IMAGE_REDIRECT_ANON = 233;
- const AS_IMAGE_REDIRECT_LOGGED = 234;
+ const AS_OK = 230;
+ const AS_END = 231;
+ const AS_SPAM_ERROR = 232;
+ const AS_IMAGE_REDIRECT_ANON = 233;
+ const AS_IMAGE_REDIRECT_LOGGED = 234;
var $mArticle;
var $mTitle;
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
# If this is a system message, get the default text.
list( $message, $lang ) = $wgMessageCache->figureMessage( $wgContLang->lcfirst( $this->mTitle->getText() ) );
- $wgMessageCache->loadAllMessages( $lang );
$text = wfMsgGetKey( $message, false, $lang, false );
if( wfEmptyMsg( $message, $text ) )
$text = $this->getPreloadedText( $preload );
*
* The edit form is self-submitting, so that when things like
* preview and edit conflicts occur, we get the same form back
- * with the extra stuff added. Only when the final submission
+ * with the extra stuff added. Only when the final submission
* is made and all is well do we actually save and redirect to
* the newly-edited page.
*/
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
- $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
- $this->isCssSubpage = $this->mTitle->isCssSubpage();
- $this->isJsSubpage = $this->mTitle->isJsSubpage();
+ $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
+ $this->isCssSubpage = $this->mTitle->isCssSubpage();
+ $this->isJsSubpage = $this->mTitle->isJsSubpage();
$this->isValidCssJsSubpage = $this->mTitle->isValidCssJsSubpage();
# Show applicable editing introductions
}
# Optional notices on a per-namespace and per-page basis
- $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace();
+ $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace();
if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
- $wgOut->addWikiText( wfMsgForContent( $editnotice_ns ) );
+ $wgOut->addWikiText( wfMsgForContent( $editnotice_ns ) );
}
if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
$parts = explode( '/', $this->mTitle->getDBkey() );
}
}
- # Attempt submission here. This will check for edit conflicts,
+ # Attempt submission here. This will check for edit conflicts,
# and redundantly check for locked database, blocked IPs, etc.
# that edit() already checked just in case someone tries to sneak
# in the back door with a hand-edited submission URL.
$this->starttime = null;
}
- $this->recreate = $request->getCheck( 'wpRecreate' );
+ $this->recreate = $request->getCheck( 'wpRecreate' );
$this->minoredit = $request->getCheck( 'wpMinoredit' );
$this->watchthis = $request->getCheck( 'wpWatchthis' );
} else {
# Not a posted form? Start with nothing.
wfDebug( __METHOD__ . ": Not a posted form.\n" );
- $this->textbox1 = '';
- $this->summary = '';
- $this->edittime = '';
+ $this->textbox1 = '';
+ $this->summary = '';
+ $this->edittime = '';
$this->starttime = wfTimestampNow();
- $this->edit = false;
- $this->preview = false;
- $this->save = false;
- $this->diff = false;
+ $this->edit = false;
+ $this->preview = false;
+ $this->save = false;
+ $this->diff = false;
$this->minoredit = false;
$this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overriden by request parameters
- $this->recreate = false;
+ $this->recreate = false;
if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) {
$this->summary = $request->getVal( 'preloadtitle' );
* @return one of the constants describing the result
*/
function internalAttemptSave( &$result, $bot = false ) {
- global $wgFilterCallback, $wgUser, $wgOut, $wgParser;
+ global $wgFilterCallback, $wgUser, $wgParser;
global $wgMaxArticleSize;
- wfProfileIn( __METHOD__ );
+ wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-checks' );
if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) {
$isComment = ( $this->section == 'new' );
- $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
- ( $this->minoredit ? EDIT_MINOR : 0 ) |
- ( $bot ? EDIT_FORCE_BOT : 0 );
- $status = $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags,
- false, null, $this->watchthis, $isComment, '', true );
+ $this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
+ $this->minoredit, $this->watchthis, false, $isComment, $bot );
- if ( $status->isOK() ) {
- wfProfileOut( __METHOD__ );
- return self::AS_SUCCESS_NEW_ARTICLE;
- } else {
- $result = $status->getErrorsArray();
- }
wfProfileOut( __METHOD__ );
- return self::AS_END;
+ return self::AS_SUCCESS_NEW_ARTICLE;
}
# Article exists. Check for edit conflict.
return self::AS_TEXTBOX_EMPTY;
}
if ( $this->summary != '' ) {
- $sectionanchor = $wgParser->guessSectionNameFromWikiText( $this->summary );
+ $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $this->summary );
# This is a new section, so create a link to the new section
# in the revision summary.
$cleanSummary = $wgParser->stripSectionName( $this->summary );
# we can't deal with anchors, includes, html etc in the header for now,
# headline would need to be parsed to improve this
if ( $hasmatch and strlen( $matches[2] ) > 0 ) {
- $sectionanchor = $wgParser->guessSectionNameFromWikiText( $matches[2] );
+ $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $matches[2] );
}
}
wfProfileOut( __METHOD__ . '-sectionanchor' );
return self::AS_MAX_ARTICLE_SIZE_EXCEEDED;
}
- // Update the article here
- $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
- ( $this->minoredit ? EDIT_MINOR : 0 ) |
- ( $bot ? EDIT_FORCE_BOT : 0 );
- $status = $this->mArticle->doEdit( $text, $this->summary, $flags,
- false, null, $this->watchthis, false, $sectionanchor, true );
-
- if ( $status->isOK() ) {
+ # update the article here
+ if ( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
+ $this->watchthis, $bot, $sectionanchor ) )
+ {
wfProfileOut( __METHOD__ );
return self::AS_SUCCESS_UPDATE;
} else {
$this->isConflict = true;
- $result = $status->getErrorsArray();
}
wfProfileOut( __METHOD__ );
return self::AS_END;
/**
* Send the edit form and related headers to $wgOut
* @param $formCallback Optional callable that takes an OutputPage
- * parameter; will be called during form output
- * near the top, for captchas and the like.
+ * parameter; will be called during form output
+ * near the top, for captchas and the like.
*/
function showEditForm( $formCallback=null ) {
global $wgOut, $wgUser, $wgTitle;
}
if ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) {
LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '',
- array( 'lim' => 1,
+ array( 'lim' => 1,
'showIfEmpty' => false,
'msgKey' => array( 'titleprotectedwarning' ),
'wrap' => "<div class=\"mw-titleprotectedwarning\">\n$1</div>" ) );
/**
* @param $isSubjectPreview Boolean: true if this is the section subject/title
- * up top, or false if this is the comment summary
- * down below the textarea
+ * up top, or false if this is the comment summary
+ * down below the textarea
* @param $summary String: The text of the summary to display
* @return String
*/
/**
* @param $isSubjectPreview Boolean: true if this is the section subject/title
- * up top, or false if this is the comment summary
- * down below the textarea
+ * up top, or false if this is the comment summary
+ * down below the textarea
* @param $summary String: the text of the summary to display
* @return String
*/
$data = $dbr->selectRow(
array( 'logging', 'user' ),
array( 'log_type',
- 'log_action',
- 'log_timestamp',
- 'log_user',
- 'log_namespace',
- 'log_title',
- 'log_comment',
- 'log_params',
- 'log_deleted',
- 'user_name' ),
+ 'log_action',
+ 'log_timestamp',
+ 'log_user',
+ 'log_namespace',
+ 'log_title',
+ 'log_comment',
+ 'log_params',
+ 'log_deleted',
+ 'user_name' ),
array( 'log_namespace' => $this->mTitle->getNamespace(),
- 'log_title' => $this->mTitle->getDBkey(),
- 'log_type' => 'delete',
- 'log_action' => 'delete',
- 'user_id=log_user' ),
+ 'log_title' => $this->mTitle->getDBkey(),
+ 'log_type' => 'delete',
+ 'log_action' => 'delete',
+ 'user_id=log_user' ),
__METHOD__,
array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' )
);
* @return string
*/
function getPreviewText() {
- global $wgOut, $wgUser, $wgTitle, $wgParser, $wgLang, $wgContLang, $wgMessageCache;
+ global $wgOut, $wgUser, $wgParser, $wgMessageCache;
wfProfileIn( __METHOD__ );
*
* @param $match Text which triggered one or more filters
*/
- function spamPage( $match = false ) {
+ static function spamPage( $match = false ) {
global $wgOut, $wgTitle;
$wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) );
$wgOut->addHTML( '<div id="spamprotected">' );
$wgOut->addWikiMsg( 'spamprotectiontext' );
- if ( $match )
+ if ( $match ) {
$wgOut->addWikiMsg( 'spamprotectionmatch', wfEscapeWikiText( $match ) );
+ }
$wgOut->addHTML( '</div>' );
$wgOut->returnToMain( false, $wgTitle );
*/
$toolarray = array(
array(
- 'image' => $wgLang->getImageFile( 'button-bold' ),
- 'id' => 'mw-editbutton-bold',
- 'open' => '\'\'\'',
- 'close' => '\'\'\'',
+ 'image' => $wgLang->getImageFile( 'button-bold' ),
+ 'id' => 'mw-editbutton-bold',
+ 'open' => '\'\'\'',
+ 'close' => '\'\'\'',
'sample' => wfMsg( 'bold_sample' ),
- 'tip' => wfMsg( 'bold_tip' ),
- 'key' => 'B'
+ 'tip' => wfMsg( 'bold_tip' ),
+ 'key' => 'B'
),
array(
- 'image' => $wgLang->getImageFile( 'button-italic' ),
- 'id' => 'mw-editbutton-italic',
- 'open' => '\'\'',
- 'close' => '\'\'',
+ 'image' => $wgLang->getImageFile( 'button-italic' ),
+ 'id' => 'mw-editbutton-italic',
+ 'open' => '\'\'',
+ 'close' => '\'\'',
'sample' => wfMsg( 'italic_sample' ),
- 'tip' => wfMsg( 'italic_tip' ),
- 'key' => 'I'
+ 'tip' => wfMsg( 'italic_tip' ),
+ 'key' => 'I'
),
array(
- 'image' => $wgLang->getImageFile( 'button-link' ),
- 'id' => 'mw-editbutton-link',
- 'open' => '[[',
- 'close' => ']]',
+ 'image' => $wgLang->getImageFile( 'button-link' ),
+ 'id' => 'mw-editbutton-link',
+ 'open' => '[[',
+ 'close' => ']]',
'sample' => wfMsg( 'link_sample' ),
- 'tip' => wfMsg( 'link_tip' ),
- 'key' => 'L'
+ 'tip' => wfMsg( 'link_tip' ),
+ 'key' => 'L'
),
array(
- 'image' => $wgLang->getImageFile( 'button-extlink' ),
- 'id' => 'mw-editbutton-extlink',
- 'open' => '[',
- 'close' => ']',
+ 'image' => $wgLang->getImageFile( 'button-extlink' ),
+ 'id' => 'mw-editbutton-extlink',
+ 'open' => '[',
+ 'close' => ']',
'sample' => wfMsg( 'extlink_sample' ),
- 'tip' => wfMsg( 'extlink_tip' ),
- 'key' => 'X'
+ 'tip' => wfMsg( 'extlink_tip' ),
+ 'key' => 'X'
),
array(
- 'image' => $wgLang->getImageFile( 'button-headline' ),
- 'id' => 'mw-editbutton-headline',
- 'open' => "\n== ",
- 'close' => " ==\n",
+ 'image' => $wgLang->getImageFile( 'button-headline' ),
+ 'id' => 'mw-editbutton-headline',
+ 'open' => "\n== ",
+ 'close' => " ==\n",
'sample' => wfMsg( 'headline_sample' ),
- 'tip' => wfMsg( 'headline_tip' ),
- 'key' => 'H'
+ 'tip' => wfMsg( 'headline_tip' ),
+ 'key' => 'H'
),
array(
- 'image' => $wgLang->getImageFile( 'button-image' ),
- 'id' => 'mw-editbutton-image',
- 'open' => '[[' . $wgContLang->getNsText( NS_FILE ) . ':',
- 'close' => ']]',
+ 'image' => $wgLang->getImageFile( 'button-image' ),
+ 'id' => 'mw-editbutton-image',
+ 'open' => '[[' . $wgContLang->getNsText( NS_FILE ) . ':',
+ 'close' => ']]',
'sample' => wfMsg( 'image_sample' ),
- 'tip' => wfMsg( 'image_tip' ),
- 'key' => 'D'
+ 'tip' => wfMsg( 'image_tip' ),
+ 'key' => 'D'
),
array(
- 'image' => $wgLang->getImageFile( 'button-media' ),
- 'id' => 'mw-editbutton-media',
- 'open' => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':',
- 'close' => ']]',
+ 'image' => $wgLang->getImageFile( 'button-media' ),
+ 'id' => 'mw-editbutton-media',
+ 'open' => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':',
+ 'close' => ']]',
'sample' => wfMsg( 'media_sample' ),
- 'tip' => wfMsg( 'media_tip' ),
- 'key' => 'M'
+ 'tip' => wfMsg( 'media_tip' ),
+ 'key' => 'M'
),
array(
- 'image' => $wgLang->getImageFile( 'button-math' ),
- 'id' => 'mw-editbutton-math',
- 'open' => "<math>",
- 'close' => "</math>",
+ 'image' => $wgLang->getImageFile( 'button-math' ),
+ 'id' => 'mw-editbutton-math',
+ 'open' => "<math>",
+ 'close' => "</math>",
'sample' => wfMsg( 'math_sample' ),
- 'tip' => wfMsg( 'math_tip' ),
- 'key' => 'C'
+ 'tip' => wfMsg( 'math_tip' ),
+ 'key' => 'C'
),
array(
- 'image' => $wgLang->getImageFile( 'button-nowiki' ),
- 'id' => 'mw-editbutton-nowiki',
- 'open' => "<nowiki>",
- 'close' => "</nowiki>",
+ 'image' => $wgLang->getImageFile( 'button-nowiki' ),
+ 'id' => 'mw-editbutton-nowiki',
+ 'open' => "<nowiki>",
+ 'close' => "</nowiki>",
'sample' => wfMsg( 'nowiki_sample' ),
- 'tip' => wfMsg( 'nowiki_tip' ),
- 'key' => 'N'
+ 'tip' => wfMsg( 'nowiki_tip' ),
+ 'key' => 'N'
),
array(
- 'image' => $wgLang->getImageFile( 'button-sig' ),
- 'id' => 'mw-editbutton-signature',
- 'open' => '--~~~~',
- 'close' => '',
+ 'image' => $wgLang->getImageFile( 'button-sig' ),
+ 'id' => 'mw-editbutton-signature',
+ 'open' => '--~~~~',
+ 'close' => '',
'sample' => '',
- 'tip' => wfMsg( 'sig_tip' ),
- 'key' => 'Y'
+ 'tip' => wfMsg( 'sig_tip' ),
+ 'key' => 'Y'
),
array(
- 'image' => $wgLang->getImageFile( 'button-hr' ),
- 'id' => 'mw-editbutton-hr',
- 'open' => "\n----\n",
- 'close' => '',
+ 'image' => $wgLang->getImageFile( 'button-hr' ),
+ 'id' => 'mw-editbutton-hr',
+ 'open' => "\n----\n",
+ 'close' => '',
'sample' => '',
- 'tip' => wfMsg( 'hr_tip' ),
- 'key' => 'R'
+ 'tip' => wfMsg( 'hr_tip' ),
+ 'key' => 'R'
)
);
$toolbar = "<div id='toolbar'>\n";
* @param $tabindex Current tabindex
* @param $skin Skin object
* @param $checked Array of checkbox => bool, where bool indicates the checked
- * status of the checkbox
+ * status of the checkbox
*
* @return array
*/
$minorLabel = wfMsgExt( 'minoredit', array( 'parseinline' ) );
if ( $wgUser->isAllowed( 'minoredit' ) ) {
$attribs = array(
- 'tabindex' => ++$tabindex,
+ 'tabindex' => ++$tabindex,
'accesskey' => wfMsg( 'accesskey-minoredit' ),
- 'id' => 'wpMinoredit',
+ 'id' => 'wpMinoredit',
);
$checkboxes['minor'] =
Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
- " <label for='wpMinoredit'" . $skin->tooltip( 'minoredit', 'withaccess' ) . ">{$minorLabel}</label>";
+ " <label for='wpMinoredit' id='mw-editpage-minoredit'" . $skin->tooltip( 'minoredit', 'withaccess' ) . ">{$minorLabel}</label>";
}
$watchLabel = wfMsgExt( 'watchthis', array( 'parseinline' ) );
$checkboxes['watch'] = '';
if ( $wgUser->isLoggedIn() ) {
$attribs = array(
- 'tabindex' => ++$tabindex,
+ 'tabindex' => ++$tabindex,
'accesskey' => wfMsg( 'accesskey-watch' ),
- 'id' => 'wpWatchthis',
+ 'id' => 'wpWatchthis',
);
$checkboxes['watch'] =
Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
- " <label for='wpWatchthis'" . $skin->tooltip( 'watch', 'withaccess' ) . ">{$watchLabel}</label>";
+ " <label for='wpWatchthis' id='mw-editpage-watch'" . $skin->tooltip( 'watch', 'withaccess' ) . ">{$watchLabel}</label>";
}
wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) );
return $checkboxes;
$buttons = array();
$temp = array(
- 'id' => 'wpSave',
- 'name' => 'wpSave',
- 'type' => 'submit',
- 'tabindex' => ++$tabindex,
- 'value' => wfMsg( 'savearticle' ),
+ 'id' => 'wpSave',
+ 'name' => 'wpSave',
+ 'type' => 'submit',
+ 'tabindex' => ++$tabindex,
+ 'value' => wfMsg( 'savearticle' ),
'accesskey' => wfMsg( 'accesskey-save' ),
- 'title' => wfMsg( 'tooltip-save' ).' ['.wfMsg( 'accesskey-save' ).']',
+ 'title' => wfMsg( 'tooltip-save' ).' ['.wfMsg( 'accesskey-save' ).']',
);
$buttons['save'] = Xml::element('input', $temp, '');
++$tabindex; // use the same for preview and live preview
$temp = array(
- 'id' => 'wpPreview',
- 'name' => 'wpPreview',
- 'type' => 'submit',
- 'tabindex' => $tabindex,
- 'value' => wfMsg( 'showpreview' ),
+ 'id' => 'wpPreview',
+ 'name' => 'wpPreview',
+ 'type' => 'submit',
+ 'tabindex' => $tabindex,
+ 'value' => wfMsg( 'showpreview' ),
'accesskey' => wfMsg( 'accesskey-preview' ),
- 'title' => wfMsg( 'tooltip-preview' ) . ' [' . wfMsg( 'accesskey-preview' ) . ']',
+ 'title' => wfMsg( 'tooltip-preview' ) . ' [' . wfMsg( 'accesskey-preview' ) . ']',
);
$buttons['preview'] = Xml::element( 'input', $temp, '' );
$buttons['live'] = '';
$temp = array(
- 'id' => 'wpDiff',
- 'name' => 'wpDiff',
- 'type' => 'submit',
- 'tabindex' => ++$tabindex,
- 'value' => wfMsg( 'showdiff' ),
+ 'id' => 'wpDiff',
+ 'name' => 'wpDiff',
+ 'type' => 'submit',
+ 'tabindex' => ++$tabindex,
+ 'value' => wfMsg( 'showdiff' ),
'accesskey' => wfMsg( 'accesskey-diff' ),
- 'title' => wfMsg( 'tooltip-diff' ) . ' [' . wfMsg( 'accesskey-diff' ) . ']',
+ 'title' => wfMsg( 'tooltip-diff' ) . ' [' . wfMsg( 'accesskey-diff' ) . ']',
);
$buttons['diff'] = Xml::element( 'input', $temp, '' );
* failure, etc).
*
* @todo This doesn't include category or interlanguage links.
- * Would need to enhance it a bit, <s>maybe wrap them in XML
- * or something...</s> that might also require more skin
- * initialization, so check whether that's a problem.
+ * Would need to enhance it a bit, <s>maybe wrap them in XML
+ * or something...</s> that might also require more skin
+ * initialization, so check whether that's a problem.
*/
function livePreview() {
global $wgOut;
$newtext = $this->mArticle->preSaveTransform( $newtext );
$oldtitle = wfMsgExt( 'currentrev', array( 'parseinline' ) );
$newtitle = wfMsgExt( 'yourtext', array( 'parseinline' ) );
- if ( $oldtext !== false || $newtext != '' ) {
+ if ( $oldtext !== false || $newtext != '' ) {
$de = new DifferenceEngine( $this->mTitle );
$de->setText( $oldtext, $newtext );
$difftext = $de->getDiff( $oldtitle, $newtitle );
switch ( $value ) {
case self::AS_HOOK_ERROR_EXPECTED:
case self::AS_CONTENT_TOO_BIG:
- case self::AS_ARTICLE_WAS_DELETED:
+ case self::AS_ARTICLE_WAS_DELETED:
case self::AS_CONFLICT_DETECTED:
case self::AS_SUMMARY_NEEDED:
case self::AS_TEXTBOX_EMPTY:
return false;
case self::AS_SPAM_ERROR:
- $this->spamPage( $resultDetails['spam'] );
+ self::spamPage( $resultDetails['spam'] );
return false;
case self::AS_BLOCKED_PAGE_FOR_USER:
$this->userNotLoggedInPage();
return false;
- case self::AS_READ_ONLY_PAGE_LOGGED:
- case self::AS_READ_ONLY_PAGE:
- $wgOut->readOnlyPage();
- return false;
+ case self::AS_READ_ONLY_PAGE_LOGGED:
+ case self::AS_READ_ONLY_PAGE:
+ $wgOut->readOnlyPage();
+ return false;
- case self::AS_RATE_LIMITED:
- $wgOut->rateLimited();
- return false;
+ case self::AS_RATE_LIMITED:
+ $wgOut->rateLimited();
+ return false;
- case self::AS_NO_CREATE_PERMISSION:
- $this->noCreatePermission();
- return;
+ case self::AS_NO_CREATE_PERMISSION:
+ $this->noCreatePermission();
+ return;
case self::AS_BLANK_ARTICLE:
- $wgOut->redirect( $wgTitle->getFullURL() );
- return false;
+ $wgOut->redirect( $wgTitle->getFullURL() );
+ return false;
case self::AS_IMAGE_REDIRECT_LOGGED:
$wgOut->permissionRequired( 'upload' );