From 46f07aa69cee0cf5ffa1806aaa4e33850260b3e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 7 Apr 2005 14:24:42 +0000 Subject: [PATCH] * changed function magicRFC: documented it, and rewrote a small part of the code, don't use stuff like $x = wfMsg( 'msg' ); $x = str_replace( '$1', $str, $x ); when you can use $x = wfMsg( 'msg', $str ); --- includes/Parser.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 4e241aa49a..f82209bea0 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2475,8 +2475,12 @@ class Parser /** * Return an HTML link for the "RFC 1234" text + * * @access private - * @param string $text text to be processed + * @param string $text Text to be processed + * @param string $keyword Magic keyword to use (default RFC) + * @param string $urlmsg Interface message to use (default rfcurl) + * @return string */ function magicRFC( $text, $keyword='RFC ', $urlmsg='rfcurl' ) { global $wgLang; @@ -2527,8 +2531,7 @@ class Parser $text .= $keyword.$id.$x; } else { /* build the external link*/ - $url = wfmsg( $urlmsg ); - $url = str_replace( '$1', $id, $url); + $url = wfMsg( $urlmsg, $id); $sk =& $this->mOptions->getSkin(); $la = $sk->getExternalLinkAttributes( $url, $keyword.$id ); $text .= "{$keyword}{$id}{$x}"; -- 2.20.1