Index: trunk/extensions/Cite/Cite_body.php |
— | — | @@ -155,6 +155,23 @@ |
156 | 156 | return $this->error( 'cite_error_ref_numeric_key' ); |
157 | 157 | } |
158 | 158 | |
| 159 | + if( strpos( |
| 160 | + preg_replace( '#<([^ ]+?).*?>.*?</\\1 *>|<!--.*?-->#', '', $str ), |
| 161 | + '<ref>' |
| 162 | + ) !== false ) { |
| 163 | + # (bug 6199) This most likely implies that someone left off the |
| 164 | + # closing </ref> tag, which will cause the entire article to be |
| 165 | + # eaten up until the next <ref>. So we bail out early instead. |
| 166 | + # The fancy regex above first tries chopping out anything that |
| 167 | + # looks like a comment or SGML tag, which is a crude way to avoid |
| 168 | + # false alarms for <nowiki>, <pre>, etc. |
| 169 | + # |
| 170 | + # Possible improvement: print the warning, followed by the contents |
| 171 | + # of the <ref> tag. This way no part of the article will be eaten |
| 172 | + # even temporarily. |
| 173 | + return $this->error( 'cite_error_included_ref' ); |
| 174 | + } |
| 175 | + |
159 | 176 | # Split these into groups. |
160 | 177 | if( $group === null ) { |
161 | 178 | $group = $default_group; |
Index: trunk/extensions/Cite/Cite.i18n.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | Define more in the <nowiki>[[MediaWiki:Cite references link many format backlink labels]]</nowiki> message', |
45 | 45 | 'cite_error_references_no_text' => 'Invalid <code><ref></code> tag; |
46 | 46 | no text was provided for refs named <code>$1</code>', |
| 47 | + 'cite_error_included_ref' => 'Closing </ref> missing for <ref> tag', |
47 | 48 | |
48 | 49 | /* |
49 | 50 | Output formatting |