* addWikiText will do the escaping for you. Use wfMsgHtml()
* if you need an escaped message.
*
+ * Brace transformation is done *after* parameter replacement, so
+ * constructs like {{plural:$1}} may be used. Be aware this may
+ * have security implications for HTML message output.
+ *
* @param $key String: lookup key for the message, usually
* defined in languages/Language.php
*/
* customize over 70 messages in order to, e.g., fix a link in every
* possible language.
*
+ * Brace transformation is done *after* parameter replacement, so
+ * constructs like {{plural:$1}} may be used. Be aware this may
+ * have security implications for HTML message output.
+ *
* @param $key String: lookup key for the message, usually
* defined in languages/Language.php
*/
/**
* Get a message from the language file, for the UI elements
+ *
+ * Brace transformation is done *after* parameter replacement, so
+ * constructs like {{plural:$1}} may be used. Be aware this may
+ * have security implications for HTML message output.
*/
function wfMsgNoDB( $key ) {
$args = func_get_args();
/**
* Get a message from the language file, for the content
+ *
+ * Brace transformation is done *after* parameter replacement, so
+ * constructs like {{plural:$1}} may be used. Be aware this may
+ * have security implications for HTML message output.
*/
function wfMsgNoDBForContent( $key ) {
global $wgForceUIMsgAsContentMsg;
/**
* Really get a message
+ *
+ * Brace transformation is done *after* parameter replacement, so
+ * constructs like {{plural:$1}} may be used. Be aware this may
+ * have security implications for HTML message output.
+ *
* @return $key String: key to get.
* @return $args
* @return $useDB Boolean
function wfMsgReal( $key, $args, $useDB, $forContent=false, $transform = true ) {
$fname = 'wfMsgReal';
- $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
+ $message = wfMsgGetKey( $key, $useDB, $forContent, false );
$message = wfMsgReplaceArgs( $message, $args );
+ if( $transform && strstr( $message, '{{' ) !== false ) {
+ global $wgParser, $wgMsgParserOptions;
+ $old = $wgMsgParserOptions->setInterfaceMessage( !$forContent );
+ $message = $wgParser->transformMsg($message, $wgMsgParserOptions);
+ $wgMsgParserOptions->setInterfaceMessage( $old );
+ }
return $message;
}
* to pre-escape them if you really do want plaintext, or just wrap
* the whole thing in htmlspecialchars().
*
+ * Brace transformation is done *before* parameter replacement, so
+ * constructs like {{plural:$1}} will not work.
+ *
* @param string $key
* @param string ... parameters
* @return string
* to pre-escape them if you really do want plaintext, or just wrap
* the whole thing in htmlspecialchars().
*
+ * Brace transformation is done *before* parameter replacement, so
+ * constructs like {{plural:$1}} will not work.
+ *
* @param string $key
* @param string ... parameters
* @return string