mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 15:04:02 +00:00
Fix crasher on 🇫🇷126e_méridien_ouest
This code is being run on: <meta property="mw:PageProp/categorydefaultsort" content="0 126"> which doesn't have a 'typeof' attribute, and so the match is crashing with a null pointer dereference. Turn the expression around. RegExp.test is more efficient, and it handles a null argument with no problems. Add start/end anchors to the regexp while we're at it. Change-Id: I11bc9fdc902a21ce0bc1c05f08d3b615d5483e2e
This commit is contained in:
parent
dca9f9d8c3
commit
80c29be19f
|
@ -345,7 +345,7 @@ References.prototype.handleReferences = function ( manager, pipelineOpts, refsTo
|
|||
var t = chunk[i];
|
||||
if (t.constructor === SelfclosingTagTk &&
|
||||
t.name === 'meta' &&
|
||||
t.getAttribute('typeof').match(/mw:Ext\/Ref\/Content/))
|
||||
/^mw:Ext\/Ref\/Content$/.test(t.getAttribute('typeof')))
|
||||
{
|
||||
res.push(t);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue