X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2FLinker.php;h=69550d31d09b651747343793b431e0ac88c04432;hb=0204a28443606a2b3026d403c625f3a089841430;hp=80e4c62f967a186039f1a15715364f88c5fe05cf;hpb=04fdc78370dbc042116488d6826e19bf3910273b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index 80e4c62f96..69550d31d0 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -346,7 +346,10 @@ class Linker { } elseif ( in_array( 'known', $options ) ) { $defaults['title'] = $target->getPrefixedText(); } else { - $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() )->text(); + // This ends up in parser cache! + $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() ) + ->inContentLanguage() + ->text(); } # Finally, merge the custom attribs with the default ones, and iterate @@ -2010,7 +2013,7 @@ class Linker { * directly paste it in as the link (escaping needs to be done manually). * Finally, if $more is a Message, call toString(). * - * @param array $templates Array of templates from Article::getUsedTemplate or similar + * @param Title[] $templates Array of templates * @param bool $preview Whether this is for a preview * @param bool $section Whether this is for a section edit * @param Title|Message|string|null $more An escaped link for "More..." of the templates @@ -2105,7 +2108,7 @@ class Linker { /** * Returns HTML for the "hidden categories on this page" list. * - * @param array $hiddencats Array of hidden categories from Article::getHiddenCategories + * @param array $hiddencats Array of hidden categories from WikiPage::getHiddenCategories * or similar * @return string HTML output */ @@ -2150,13 +2153,13 @@ class Linker { * @param string $name Id of the element, minus prefixes. * @param string|null $options Null or the string 'withaccess' to add an access- * key hint + * @param array $msgParams Parameters to pass to the message + * * @return string Contents of the title attribute (which you must HTML- * escape), or false for no title attribute */ - public static function titleAttrib( $name, $options = null ) { - - $message = wfMessage( "tooltip-$name" ); - + public static function titleAttrib( $name, $options = null, array $msgParams = array() ) { + $message = wfMessage( "tooltip-$name", $msgParams ); if ( !$message->exists() ) { $tooltip = false; } else { @@ -2306,15 +2309,18 @@ class Linker { /** * Returns the attributes for the tooltip and access key. + * * @param string $name + * @param array $msgParams Params for constructing the message + * * @return array */ - public static function tooltipAndAccesskeyAttribs( $name ) { + public static function tooltipAndAccesskeyAttribs( $name, array $msgParams = array() ) { # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output # no attribute" instead of "output '' as value for attribute", this # would be three lines. $attribs = array( - 'title' => self::titleAttrib( $name, 'withaccess' ), + 'title' => self::titleAttrib( $name, 'withaccess', $msgParams ), 'accesskey' => self::accesskey( $name ) ); if ( $attribs['title'] === false ) {