mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-30 17:54:20 +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' );
|
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.
|
||||||
|
|
Loading…
Reference in a new issue