* @see Content::replaceSection()
*/
public function replaceSection( $sectionId, Content $with, $sectionTitle = '' ) {
- wfProfileIn( __METHOD__ );
$myModelId = $this->getModel();
$sectionModelId = $with->getModel();
if ( $sectionModelId != $myModelId ) {
- wfProfileOut( __METHOD__ );
throw new MWException( "Incompatible content model for section: " .
"document uses $myModelId but " .
"section uses $sectionModelId." );
$text = $with->getNativeData();
if ( strval( $sectionId ) === '' ) {
- wfProfileOut( __METHOD__ );
-
return $with; # XXX: copy first?
}
$newContent = new static( $text );
- wfProfileOut( __METHOD__ );
-
return $newContent;
}
return false;
}
- $text = $this->getNativeData();
-
switch ( $wgArticleCountMethod ) {
case 'any':
return true;
case 'comma':
+ $text = $this->getNativeData();
return strpos( $text, ',' ) !== false;
case 'link':
if ( $hasLinks === null ) { # not known, find out