# not told otherwise, and so may cause a change to mTitle.
# Return the text of this revision
- function getContent( $noredir = false )
+ function getContent( $noredir )
{
global $wgRequest;
# split it up by section
$secs =
preg_split(
- "/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",
+ "/(^=+.*?=+|^<h[1-6].*?" . ">.*?<\/h[1-6].*?" . ">)/mi",
$striptext, -1,
PREG_SPLIT_DELIM_CAPTURE);
}
}
- $text = $this->getContent(); # May change mTitle
+ $text = $this->getContent( false ); # May change mTitle by following a redirect
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
# We're looking at an old revision
/* Side effects: loads last edit */
function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = ""){
$this->loadLastEdit();
- $oldtext = $this->getContent();
+ $oldtext = $this->getContent( true );
if ($section != "") {
if($section=="new") {
if($summary) $subject="== {$summary} ==\n\n";
# now that we can be sure that no pseudo-sections are in the source,
# split it up
- $secs=preg_split("/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",
+ $secs=preg_split("/(^=+.*?=+|^<h[1-6].*?" . ">.*?<\/h[1-6].*?" . ">)/mi",
$oldtext,-1,PREG_SPLIT_DELIM_CAPTURE);
$secs[$section*2]=$text."\n\n"; // replace with edited
if($section) { $secs[$section*2-1]=""; } // erase old headline
return;
}
if ( wfReadOnly() ) {
- $wgOut->readOnlyPage( $this->getContent() );
+ $wgOut->readOnlyPage( $this->getContent( true ) );
return;
}
$this->importFormData( $wgRequest );
if ( ! $this->mTitle->userCanEdit() ) {
- $wgOut->readOnlyPage( $this->mArticle->getContent(), true );
+ $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
return;
}
if ( $wgUser->isBlocked() ) {
if( $this->save || $this->preview ) {
$this->editForm( "preview" );
} else {
- $wgOut->readOnlyPage( $this->mArticle->getContent() );
+ $wgOut->readOnlyPage( $this->mArticle->getContent( true ) );
}
return;
}
if ( "initial" == $formtype ) {
$this->edittime = $this->mArticle->getTimestamp();
- $this->textbox1 = $this->mArticle->getContent(true);
+ $this->textbox1 = $this->mArticle->getContent( true );
$this->summary = "";
$this->proxyCheck();
}
$wgOut->addHTML( wfMsg( "explainconflict" ) );
$this->textbox2 = $this->textbox1;
- $this->textbox1 = $this->mArticle->getContent(true);
+ $this->textbox1 = $this->mArticle->getContent( true );
$this->edittime = $this->mArticle->getTimestamp();
} else {
$s = wfMsg( "editing", $this->mTitle->getPrefixedText() );