Index: trunk/extensions/Cite/Cite_body.php |
— | — | @@ -706,7 +706,7 @@ |
707 | 707 | 'cite_references_link_one', |
708 | 708 | $this->referencesKey( $key ), |
709 | 709 | $this->refKey( $key, $val['count'] ), |
710 | | - $this->error( 'cite_error_references_no_text', $key ) |
| 710 | + $this->error( 'cite_error_references_no_text', $key, false ) |
711 | 711 | ); |
712 | 712 | } |
713 | 713 | |
— | — | @@ -717,7 +717,7 @@ |
718 | 718 | # $this->refKey( $val['key'], $val['count'] ), |
719 | 719 | $this->refKey( $val['key'] ), |
720 | 720 | |
721 | | - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |
| 721 | + ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) |
722 | 722 | ); |
723 | 723 | // Standalone named reference, I want to format this like an |
724 | 724 | // anonymous reference because displaying "1. 1.1 Ref text" is |
— | — | @@ -729,7 +729,7 @@ |
730 | 730 | $this->referencesKey( $key . "-" . $val['key'] ), |
731 | 731 | # $this->refKey( $key, $val['count'] ), |
732 | 732 | $this->refKey( $key, $val['key'] . "-" . $val['count'] ), |
733 | | - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |
| 733 | + ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) |
734 | 734 | ); |
735 | 735 | // Named references with >1 occurrences |
736 | 736 | } else { |
— | — | @@ -749,7 +749,7 @@ |
750 | 750 | return wfMsgForContentNoTrans( 'cite_references_link_many', |
751 | 751 | $this->referencesKey( $key . "-" . $val['key'] ), |
752 | 752 | $list, |
753 | | - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |
| 753 | + ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) |
754 | 754 | ); |
755 | 755 | } |
756 | 756 | } |
— | — | @@ -793,7 +793,7 @@ |
794 | 794 | return $this->mBacklinkLabels[$offset]; |
795 | 795 | } else { |
796 | 796 | // Feed me! |
797 | | - return $this->error( 'cite_error_references_no_backlink_label' ); |
| 797 | + return $this->error( 'cite_error_references_no_backlink_label', null, false ); |
798 | 798 | } |
799 | 799 | } |
800 | 800 | |
— | — | @@ -823,7 +823,7 @@ |
824 | 824 | return $this->mLinkLabels[$group][$offset - 1]; |
825 | 825 | } else { |
826 | 826 | // Feed me! |
827 | | - return $this->error( 'cite_error_no_link_label_group', array( $group, $message ) ); |
| 827 | + return $this->error( 'cite_error_no_link_label_group', array( $group, $message ), false ); |
828 | 828 | } |
829 | 829 | } |
830 | 830 | |
— | — | @@ -1065,11 +1065,14 @@ |
1066 | 1066 | continue; |
1067 | 1067 | } |
1068 | 1068 | $text .= "\n<br />"; |
| 1069 | + # Use separate parser from MessageCache to avoid it missing |
| 1070 | + # replaceLinkHolders() when run from ParserBeforeTidy. |
1069 | 1071 | if ( $group == CITE_DEFAULT_GROUP ) { |
1070 | | - $text .= $this->error( 'cite_error_refs_without_references' ); |
| 1072 | + $msg = $this->error( 'cite_error_refs_without_references', null, false ); |
1071 | 1073 | } else { |
1072 | | - $text .= $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) ); |
| 1074 | + $msg = $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ), false ); |
1073 | 1075 | } |
| 1076 | + $text .= MessageCache::singleton()->parse( $msg, $parser->getTitle(), false )->getText(); |
1074 | 1077 | } |
1075 | 1078 | return true; |
1076 | 1079 | } |
— | — | @@ -1117,18 +1120,20 @@ |
1118 | 1121 | * |
1119 | 1122 | * @param string $key Message name for the error |
1120 | 1123 | * @param string $param Parameter to pass to the message |
1121 | | - * @return string XHTML ready for output |
| 1124 | + * @param boolean $parse Whether to parse the message |
| 1125 | + * @return string XHTML or wikitext ready for output |
1122 | 1126 | */ |
1123 | | - function error( $key, $param = null ) { |
| 1127 | + function error( $key, $param = null, $parse = true ) { |
1124 | 1128 | # We rely on the fact that PHP is okay with passing unused argu- |
1125 | 1129 | # ments to functions. If $1 is not used in the message, wfMsg will |
1126 | 1130 | # just ignore the extra parameter. |
1127 | | - return |
1128 | | - $this->parse( |
1129 | | - '<strong class="error">' . |
1130 | | - wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) . |
1131 | | - '</strong>' |
1132 | | - ); |
| 1131 | + $ret = '<strong class="error">' . |
| 1132 | + wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) . |
| 1133 | + '</strong>'; |
| 1134 | + if ( $parse ) { |
| 1135 | + $ret = $this->parse( $ret ); |
| 1136 | + } |
| 1137 | + return $ret; |
1133 | 1138 | } |
1134 | 1139 | |
1135 | 1140 | /** |