From: Raimond Spekking Date: Wed, 6 Feb 2008 11:45:38 +0000 (+0000) Subject: * (bug 12239) Use different separators for autocomments X-Git-Tag: 1.31.0-rc.0~49582 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=63c76e813477ea72fb4ad962aee73fc0ef575a8f;p=lhc%2Fweb%2Fwiklou.git * (bug 12239) Use different separators for autocomments This avoids confusion if there was some text deleted (which is often marked as "- foobar" by contributors) or a normal comment. Based on a patch of Danny B --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9a4e50162a..a29619a54b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -157,6 +157,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN and installed when at the superuser level. * The default robot policy for the entire wiki is now configurable via the $wgDefaultRobotPolicy setting. +* (bug 12239) Use different separators for autocomments === Bug fixes in 1.12 === diff --git a/includes/Linker.php b/includes/Linker.php index 7861a8f046..11d3854c72 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -973,8 +973,9 @@ class Linker { * add a separator where needed and format the comment itself with CSS * Called by Linker::formatComment. * - * @param $comment Comment text - * @param $title An optional title object used to links to sections + * @param string $comment Comment text + * @param object $title An optional title object used to links to sections + * @return string $comment formatted comment * * @todo Document the $local parameter. */ @@ -1002,14 +1003,17 @@ class Linker { $sectionTitle = wfClone( $title ); $sectionTitle->mFragment = $section; } - $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) ); + $link = $this->makeKnownLinkObj( $sectionTitle, wfMsgForContent( 'sectionlink' ) ); } - $sep='-'; - $auto=$link.$auto; - if($pre) { $auto = $sep.' '.$auto; } - if($post) { $auto .= ' '.$sep; } - $auto=''.$auto.''; - $comment=$pre.$auto.$post; + $auto = $link . $auto; + if( $pre ) { + $auto = '- ' . $auto; # written summary $presep autocomment (summary /* section */) + } + if( $post ) { + $auto .= ': '; # autocomment $postsep written summary (/* section */ summary) + } + $auto = '' . $auto . ''; + $comment = $pre . $auto . $post; } return $comment;