Index: Cite_body.php =================================================================== --- Cite_body.php (revision 102969) +++ Cite_body.php (working copy) @@ -1123,12 +1123,21 @@ # We rely on the fact that PHP is okay with passing unused argu- # ments to functions. If $1 is not used in the message, wfMsg will # just ignore the extra parameter. - return - $this->parse( - '' . - wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) . - '' - ); + # Also, use separate parser from MessageCache to avoid issues when + # errors are produced from ParserBeforeTidy (bug #17865). Error + # messages also should not pollute the wgParser state. + $string = MessageCache::singleton()->parse( + wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) + , $this->mParser->mTitle + , true + )->getText(); + # Emulate 'parseinline' in wfMsgExt + $m = array(); + if( preg_match( '/^

(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { + $string = $m[1]; + } + return '' . $string . ''; + } /**