MarkAHershberger has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390078 )

Change subject: Don't wrap Documents with <body> tags
......................................................................

Don't wrap Documents with <body> tags

Some old comments get to this point as entire HTML documents,
including <!DOCTYPE's.  This function shouldn't wrap those documents
in <body>.

Alternatively, it might make sense to do a stristr check for <body>.
Or we could try parsing again without calling createDOM().

Bug: T108089
Change-Id: I124c4ceff4ee612ec3cb567decf99ddf08c50f74
---
M includes/Parsoid/ContentFixer.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/78/390078/1

diff --git a/includes/Parsoid/ContentFixer.php 
b/includes/Parsoid/ContentFixer.php
index 6ecda82..5eb9aa7 100644
--- a/includes/Parsoid/ContentFixer.php
+++ b/includes/Parsoid/ContentFixer.php
@@ -82,7 +82,10 @@
                 * The body tag is required otherwise <meta> tags at the top are
                 * magic'd into <head> rather than kept with the content.
                 */
-               if ( substr( $content, 0, 5 ) !== '<body' ) {
+               if (
+                       substr( $content, 0, 5 ) !== '<body'
+                       && substr( $content, 0, 9 ) !== '<!DOCTYPE'
+               ) {
                        // BC: content currently comes from parsoid and is 
stored
                        // wrapped in <body> tags, but prior to I0d9659f we were
                        // storing only the contents and not the body tag 
itself.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I124c4ceff4ee612ec3cb567decf99ddf08c50f74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>

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

Reply via email to