content loading and viewing, for clarity and consistency.
* (bug 4104) 'OutputPageBeforeHTML' hook to postprocess article HTML on
page view (comes after parser cache, if used). Patch by ThomasV.
+* Linker::formatComment corrupted the passed title object on PHP 5
+ if the comment included a section link. Use clone() to make a safe copy.
=== Caveats ===
* comments. It escapes any HTML in the comment, but adds some CSS to format
* auto-generated comments (from section editing) and formats [[wikilinks]].
*
- * The &$title parameter must be a title OBJECT. It is used to generate a
+ * The $title parameter must be a title OBJECT. It is used to generate a
* direct link to the section in the autocomment.
* @author Erik Moeller <moeller@scireview.de>
*
$auto=$match[2];
$post=$match[3];
$link='';
- if($title) {
- $section=$auto;
+ if( $title ) {
+ $section = $auto;
# This is hackish but should work in most cases.
- $section=str_replace('[[','',$section);
- $section=str_replace(']]','',$section);
- $title->mFragment=$section;
- $link=$this->makeKnownLinkObj($title,wfMsg('sectionlink'));
+ $section = str_replace( '[[', '', $section );
+ $section = str_replace( ']]', '', $section );
+ $sectionTitle = clone( $title );
+ $sectionTitle->mFragment = $section;
+ $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
}
$sep='-';
$auto=$link.$auto;