X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fcontent%2FWikitextContent.php;h=dbe09f91c9b20452bc2858f50d949f43938256eb;hb=a6c17640fc571ebd173e5460bfbda599cf5f5f67;hp=9a8ab3a6c4e1b25ea02ba78742e86bb2ace8b416;hpb=d785664ff326c545b3bf10e48b8b39f8b2fb5402;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index 9a8ab3a6c4..dbe09f91c9 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -68,13 +68,11 @@ class WikitextContent extends TextContent { * @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." ); @@ -84,7 +82,6 @@ class WikitextContent extends TextContent { $text = $with->getNativeData(); if ( strval( $sectionId ) === '' ) { - wfProfileOut( __METHOD__ ); return $with; # XXX: copy first? } @@ -93,7 +90,7 @@ class WikitextContent extends TextContent { # Inserting a new section $subject = $sectionTitle ? wfMessage( 'newsectionheaderdefaultlevel' ) ->rawParams( $sectionTitle )->inContentLanguage()->text() . "\n\n" : ''; - if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) { + if ( Hooks::run( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) { $text = strlen( trim( $oldtext ) ) > 0 ? "{$oldtext}\n\n{$subject}{$text}" : "{$subject}{$text}"; @@ -107,8 +104,6 @@ class WikitextContent extends TextContent { $newContent = new static( $text ); - wfProfileOut( __METHOD__ ); - return $newContent; }