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

Change subject: Exit with fatal (rather than error) when we can't serialize a 
<ref>
......................................................................


Exit with fatal (rather than error) when we can't serialize a <ref>

* If we cannot find the HTML for a <ref>, we used to log an error
  and happily continue serializing. However, this can cause page
  corruptions by losing <ref> contents. Better to use "fatal"
  and return a http 500 rather than continue.

Change-Id: I684f0117ef326646e0da63fb0c82c0cfdf964d04
---
M lib/mediawiki.WikitextSerializer.js
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Marcoil: Looks good to me, approved
  Catrope: Looks good to me, but someone else must approve
  GWicke: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/lib/mediawiki.WikitextSerializer.js 
b/lib/mediawiki.WikitextSerializer.js
index a9ade8f..3fc91b0 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -578,8 +578,11 @@
                                if (bodyElt) {
                                        htmlText = bodyElt.innerHTML;
                                } else {
-                                       this.env.log("error",
-                                               "extension src id points to 
non-existent element for: " + node.outerHTML);
+                                       // Bail out of here since we cannot 
meaningfully recover
+                                       // from this without losing content and 
corrupting the page.
+                                       state.env.log("fatal",
+                                               "extension src id points to 
non-existent element for: ",
+                                               node.outerHTML);
                                }
                        }
                        if (htmlText) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I684f0117ef326646e0da63fb0c82c0cfdf964d04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Marcoil <[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