Fix for last commit

My last commit didn't catch anything but plain <ref>: <ref name="foo"> would be allowed.  Fixed using a regex from the patch on bug 12757 by Max Semenik.
This commit is contained in:
Aryeh Gregor 2008-09-18 17:21:13 +00:00
parent 1c902f410c
commit 2cd995f73c

View file

@ -155,10 +155,10 @@ class Cite {
return $this->error( 'cite_error_ref_numeric_key' ); return $this->error( 'cite_error_ref_numeric_key' );
} }
if( strpos( if( preg_match(
preg_replace( '#<([^ ]+?).*?>.*?</\\1 *>|<!--.*?-->#', '', $str ), '/<ref\b[^<]*?>/',
'<ref>' preg_replace( '#<([^ ]+?).*?>.*?</\\1 *>|<!--.*?-->#', '', $str )
) !== false ) { ) ) {
# (bug 6199) This most likely implies that someone left off the # (bug 6199) This most likely implies that someone left off the
# closing </ref> tag, which will cause the entire article to be # closing </ref> tag, which will cause the entire article to be
# eaten up until the next <ref>. So we bail out early instead. # eaten up until the next <ref>. So we bail out early instead.