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>' );
}
}
}