mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
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:
parent
1c902f410c
commit
2cd995f73c
|
@ -155,10 +155,10 @@ class Cite {
|
|||
return $this->error( 'cite_error_ref_numeric_key' );
|
||||
}
|
||||
|
||||
if( strpos(
|
||||
preg_replace( '#<([^ ]+?).*?>.*?</\\1 *>|<!--.*?-->#', '', $str ),
|
||||
'<ref>'
|
||||
) !== false ) {
|
||||
if( preg_match(
|
||||
'/<ref\b[^<]*?>/',
|
||||
preg_replace( '#<([^ ]+?).*?>.*?</\\1 *>|<!--.*?-->#', '', $str )
|
||||
) ) {
|
||||
# (bug 6199) This most likely implies that someone left off the
|
||||
# closing </ref> tag, which will cause the entire article to be
|
||||
# eaten up until the next <ref>. So we bail out early instead.
|
||||
|
|
Loading…
Reference in a new issue