-/**
- * Return an HTML-escaped version of a message.
- * Parameter replacements, if any, are done *after* the HTML-escaping,
- * so parameters may contain HTML (eg links or form controls). Be sure
- * to pre-escape them if you really do want plaintext, or just wrap
- * the whole thing in htmlspecialchars().
- *
- * @deprecated since 1.18
- *
- * @param string $key
- * @param string $args,... Parameters
- * @return string
- */
-function wfMsgHtml( $key ) {
- wfDeprecated( __METHOD__, '1.21' );
-
- $args = func_get_args();
- array_shift( $args );
- return wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $key ) ), $args );
-}
-
-/**
- * Return an HTML version of message
- * Parameter replacements, if any, are done *after* parsing the wiki-text message,
- * so parameters may contain HTML (eg links or form controls). Be sure
- * to pre-escape them if you really do want plaintext, or just wrap
- * the whole thing in htmlspecialchars().
- *
- * @deprecated since 1.18
- *
- * @param string $key
- * @param string $args,... Parameters
- * @return string
- */
-function wfMsgWikiHtml( $key ) {
- wfDeprecated( __METHOD__, '1.21' );
-
- $args = func_get_args();
- array_shift( $args );
- return wfMsgReplaceArgs(
- MessageCache::singleton()->parse( wfMsgGetKey( $key ), null,
- /* can't be set to false */ true, /* interface */ true )->getText(),
- $args );
-}
-
-/**
- * Returns message in the requested format
- *
- * @deprecated since 1.18
- *
- * @param string $key Key of the message
- * @param array $options Processing rules.
- * Can take the following options:
- * parse: parses wikitext to HTML
- * parseinline: parses wikitext to HTML and removes the surrounding
- * p's added by parser or tidy
- * escape: filters message through htmlspecialchars
- * escapenoentities: same, but allows entity references like   through
- * replaceafter: parameters are substituted after parsing or escaping
- * parsemag: transform the message using magic phrases
- * content: fetch message for content language instead of interface
- * Also can accept a single associative argument, of the form 'language' => 'xx':
- * language: Language object or language code to fetch message for
- * (overridden by content).
- * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
- *
- * @return string
- */
-function wfMsgExt( $key, $options ) {
- wfDeprecated( __METHOD__, '1.21' );
-
- $args = func_get_args();
- array_shift( $args );
- array_shift( $args );
- $options = (array)$options;
- $validOptions = array( 'parse', 'parseinline', 'escape', 'escapenoentities', 'replaceafter',
- 'parsemag', 'content' );
-
- foreach ( $options as $arrayKey => $option ) {
- if ( !preg_match( '/^[0-9]+|language$/', $arrayKey ) ) {
- // An unknown index, neither numeric nor "language"
- wfWarn( "wfMsgExt called with incorrect parameter key $arrayKey", 1, E_USER_WARNING );
- } elseif ( preg_match( '/^[0-9]+$/', $arrayKey ) && !in_array( $option, $validOptions ) ) {
- // A numeric index with unknown value
- wfWarn( "wfMsgExt called with incorrect parameter $option", 1, E_USER_WARNING );
- }
- }
-
- if ( in_array( 'content', $options, true ) ) {
- $forContent = true;
- $langCode = true;
- $langCodeObj = null;
- } elseif ( array_key_exists( 'language', $options ) ) {
- $forContent = false;
- $langCode = wfGetLangObj( $options['language'] );
- $langCodeObj = $langCode;
- } else {
- $forContent = false;
- $langCode = false;
- $langCodeObj = null;
- }
-
- $string = wfMsgGetKey( $key, /*DB*/true, $langCode, /*Transform*/false );
-
- if ( !in_array( 'replaceafter', $options, true ) ) {
- $string = wfMsgReplaceArgs( $string, $args );
- }
-
- $messageCache = MessageCache::singleton();
- $parseInline = in_array( 'parseinline', $options, true );
- if ( in_array( 'parse', $options, true ) || $parseInline ) {
- $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj );
- if ( $string instanceof ParserOutput ) {
- $string = $string->getText();
- }
-
- if ( $parseInline ) {
- $string = Parser::stripOuterParagraph( $string );
- }
- } elseif ( in_array( 'parsemag', $options, true ) ) {
- $string = $messageCache->transform( $string,
- !$forContent, $langCodeObj );
- }
-
- if ( in_array( 'escape', $options, true ) ) {
- $string = htmlspecialchars( $string );
- } elseif ( in_array( 'escapenoentities', $options, true ) ) {
- $string = Sanitizer::escapeHtmlAllowEntities( $string );
- }
-
- if ( in_array( 'replaceafter', $options, true ) ) {
- $string = wfMsgReplaceArgs( $string, $args );
- }
-
- return $string;
-}
-