jenkins-bot has submitted this change and it was merged.

Change subject: Fix crasher on :fr:126e_méridien_ouest
......................................................................


Fix crasher on :fr: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
---
M js/lib/ext.Cite.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  GWicke: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/js/lib/ext.Cite.js b/js/lib/ext.Cite.js
index b49b088..3b3b818 100644
--- a/js/lib/ext.Cite.js
+++ b/js/lib/ext.Cite.js
@@ -345,7 +345,7 @@
                                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);
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/60666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I11bc9fdc902a21ce0bc1c05f08d3b615d5483e2e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to