BryanDavis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/165964
Change subject: Strip extra Parsoid response if present
......................................................................
Strip extra Parsoid response if present
For no reason I can discern, on the testing instance in Labs Parsoid is
not respecting the body=1 post parameter and returning a full html
document instead of the requested body fragment. Rather than spend a lot
of time debugging this issue I'm going to cheat and adjust the regex
used to strip the body tag so that it will also strip any additional
surrounding document.
Change-Id: If5c68095fea70778cd0b6e33e83a001aeaeacbc1
---
M src/ParsoidClient.php
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/iegreview
refs/changes/64/165964/1
diff --git a/src/ParsoidClient.php b/src/ParsoidClient.php
index 8439b25..babb1c3 100644
--- a/src/ParsoidClient.php
+++ b/src/ParsoidClient.php
@@ -151,6 +151,6 @@
// but in this case we are trusting Parsoid to be returning
clean HTML
// and all we want to do is unwrap our payload from the
// <body>...</body> tag.
- return preg_replace( '@^<body[^>]+>(.*)</body>$@', '$1', $body
);
+ return preg_replace( '@.*<body[^>]+>(.*)</body>.*@s', '$1',
$body );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/165964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If5c68095fea70778cd0b6e33e83a001aeaeacbc1
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/iegreview
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits