// Standard preference behaviour
return true;
} elseif ( !$this->mTitle->exists() &&
- isset( $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) &&
- $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] )
+ isset( $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) &&
+ $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] )
{
// Categories are special
return true;
wfProfileOut( get_class( $this ) . "::importContentFormData" );
}
- # Trim spaces on user supplied text
- $summary = trim( $request->getText( 'wpSummary' ) );
-
# Truncate for whole multibyte characters
- $this->summary = $wgContLang->truncate( $summary, 255 );
+ $this->summary = $wgContLang->truncate( $request->getText( 'wpSummary' ), 255 );
# If the summary consists of a heading, e.g. '==Foobar==', extract the title from the
# header syntax, e.g. 'Foobar'. This is mainly an issue when we are using wpSummary for
return false;
case self::AS_PARSE_ERROR:
- $wgOut->addWikiText( '<div class="error">' . $status->getWikiText() . '</div>');
+ $wgOut->addWikiText( '<div class="error">' . $status->getWikiText() . '</div>' );
return true;
case self::AS_SUCCESS_NEW_ARTICLE:
} catch ( MWContentSerializationException $ex ) {
// this can't really happen, but be nice if it does.
$msg = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
- $wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>');
+ $wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
}
}
* @return String
*/
protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
+ // avoid spaces in preview, gets always trimmed on save
+ $summary = trim( $summary );
if ( !$summary || ( !$this->preview && !$this->diff ) ) {
return "";
}
$this->showDiff();
} catch ( MWContentSerializationException $ex ) {
$msg = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
- $wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>');
+ $wgOut->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
}
}
}
$dbr = wfGetDB( DB_SLAVE );
$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' ),
- array( 'log_namespace' => $this->mTitle->getNamespace(),
- 'log_title' => $this->mTitle->getDBkey(),
- 'log_type' => 'delete',
- 'log_action' => 'delete',
- 'user_id=log_user' ),
+ array(
+ 'log_type',
+ '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'
+ ),
__METHOD__,
array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' )
);
if ( $this->mTriedSave && !$this->mTokenOk ) {
if ( $this->mTokenOkExceptSuffix ) {
- $note = wfMessage( 'token_suffix_mismatch' )->plain() ;
+ $note = wfMessage( 'token_suffix_mismatch' )->plain();
} else {
- $note = wfMessage( 'session_fail_preview' )->plain() ;
+ $note = wfMessage( 'session_fail_preview' )->plain();
}
} elseif ( $this->incompleteForm ) {
- $note = wfMessage( 'edit_form_incomplete' )->plain() ;
+ $note = wfMessage( 'edit_form_incomplete' )->plain();
} else {
$note = wfMessage( 'previewnote' )->plain() .
' [[#' . self::EDITFORM_ID . '|' . $wgLang->getArrow() . ' ' . wfMessage( 'continue-editing' )->text() . ']]';
$parserOptions = $this->mArticle->makeParserOptions( $this->mArticle->getContext() );
$parserOptions->setEditSection( false );
$parserOptions->setIsPreview( true );
- $parserOptions->setIsSectionPreview( !is_null($this->section) && $this->section !== '' );
+ $parserOptions->setIsSectionPreview( !is_null( $this->section ) && $this->section !== '' );
# don't parse non-wikitext pages, show message about preview
if ( $this->mTitle->isCssJsSubpage() || $this->mTitle->isCssOrJsPage() ) {
# Used messages to make sure grep find them:
# Messages: usercsspreview, userjspreview, sitecsspreview, sitejspreview
if( $level && $format ) {
- $note = "<div id='mw-{$level}{$format}preview'>" . wfMessage( "{$level}{$format}preview" )->text() . "</div>";
+ $note = "<div id='mw-{$level}{$format}preview'>" . wfMessage( "{$level}{$format}preview" )->text() . "</div>";
}
}
}
}
} catch ( MWContentSerializationException $ex ) {
- $m = wfMessage('content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
+ $m = wfMessage( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
$note .= "\n\n" . $m->parse();
$previewHTML = '';
}