X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=9fcac6580fd69f5bf9e9f1c4a4a7b144c0330c52;hb=ce00cb85843a2c89e9a9409fe383aa61e222218f;hp=8e02fd9b6b1be2765b8f27473a027cf516401690;hpb=aab0f8bc6f4aa9eb9d898eaad652f78160942b2b;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/Linker.php b/includes/Linker.php
index 8e02fd9b6b..9fcac6580f 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -1041,7 +1041,10 @@ class Linker {
wfRunHooks( 'UserToolLinksEdit', array( $userId, $userText, &$items ) );
if ( $items ) {
- return ' ' . wfMessage( 'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped() . '';
+ return wfMessage( 'word-separator' )->plain()
+ . ''
+ . wfMessage( 'parentheses' )->rawParams( $wgLang->pipeList( $items ) )->escaped()
+ . '';
} else {
return '';
}
@@ -1125,8 +1128,9 @@ class Linker {
} elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
$userId = $rev->getUser( Revision::FOR_THIS_USER );
$userText = $rev->getUserText( Revision::FOR_THIS_USER );
- $link = self::userLink( $userId, $userText ) .
- ' ' . self::userToolLinks( $userId, $userText );
+ $link = self::userLink( $userId, $userText )
+ . wfMessage( 'word-separator' )->plain()
+ . self::userToolLinks( $userId, $userText );
} else {
$link = wfMsgHtml( 'rev-deleted-user' );
}
@@ -1212,41 +1216,45 @@ class Linker {
$pre = $match[1];
$auto = $match[2];
$post = $match[3];
- $link = '';
- if ( $title ) {
- $section = $auto;
-
- # Remove links that a user may have manually put in the autosummary
- # This could be improved by copying as much of Parser::stripSectionName as desired.
- $section = str_replace( '[[:', '', $section );
- $section = str_replace( '[[', '', $section );
- $section = str_replace( ']]', '', $section );
-
- $section = Sanitizer::normalizeSectionNameWhitespace( $section ); # bug 22784
- if ( $local ) {
- $sectionTitle = Title::newFromText( '#' . $section );
- } else {
- $sectionTitle = Title::makeTitleSafe( $title->getNamespace(),
- $title->getDBkey(), $section );
+ $comment = null;
+ wfRunHooks( 'FormatAutocomments', array( &$comment, $pre, $auto, $post, $title, $local ) );
+ if ( $comment === null ) {
+ $link = '';
+ if ( $title ) {
+ $section = $auto;
+
+ # Remove links that a user may have manually put in the autosummary
+ # This could be improved by copying as much of Parser::stripSectionName as desired.
+ $section = str_replace( '[[:', '', $section );
+ $section = str_replace( '[[', '', $section );
+ $section = str_replace( ']]', '', $section );
+
+ $section = Sanitizer::normalizeSectionNameWhitespace( $section ); # bug 22784
+ if ( $local ) {
+ $sectionTitle = Title::newFromText( '#' . $section );
+ } else {
+ $sectionTitle = Title::makeTitleSafe( $title->getNamespace(),
+ $title->getDBkey(), $section );
+ }
+ if ( $sectionTitle ) {
+ $link = self::link( $sectionTitle,
+ $wgLang->getArrow(), array(), array(),
+ 'noclasses' );
+ } else {
+ $link = '';
+ }
}
- if ( $sectionTitle ) {
- $link = self::link( $sectionTitle,
- $wgLang->getArrow(), array(), array(),
- 'noclasses' );
- } else {
- $link = '';
+ if ( $pre ) {
+ # written summary $presep autocomment (summary /* section */)
+ $pre .= wfMsgExt( 'autocomment-prefix', array( 'escapenoentities', 'content' ) );
}
+ if ( $post ) {
+ # autocomment $postsep written summary (/* section */ summary)
+ $auto .= wfMsgExt( 'colon-separator', array( 'escapenoentities', 'content' ) );
+ }
+ $auto = '';
+ $comment = $pre . $link . $wgLang->getDirMark() . '' . $auto . $post . '';
}
- if ( $pre ) {
- # written summary $presep autocomment (summary /* section */)
- $pre .= wfMsgExt( 'autocomment-prefix', array( 'escapenoentities', 'content' ) );
- }
- if ( $post ) {
- # autocomment $postsep written summary (/* section */ summary)
- $auto .= wfMsgExt( 'colon-separator', array( 'escapenoentities', 'content' ) );
- }
- $auto = '';
- $comment = $pre . $link . $wgLang->getDirMark() . '' . $auto . $post . '';
return $comment;
}
@@ -1641,9 +1649,9 @@ class Linker {
* @return string
*/
public static function generateRollback( $rev ) {
- return '['
- . self::buildRollbackLink( $rev )
- . ']';
+ return ''
+ . wfMessage( 'brackets' )->rawParams( self::buildRollbackLink( $rev ) )->plain()
+ . '';
}
/**