From a4d055587e17b7434bf916a99aa2eebf0497a729 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 29 Apr 2009 13:12:27 +0000 Subject: [PATCH] API: (bug 18617) Add xml:space="preserve" attribute to relevant tags in XML output so overzealous XML parsers will leave whitespace in e.g. revision content alone --- RELEASE-NOTES | 1 + includes/api/ApiFormatXml.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ed136a90a3..015ee30433 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -435,6 +435,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 18601) generator=backlinks returns invalid continue parameter * (bug 18597) Internal error with empty generator= parameter * (bug 16422) Don't display help for format=jsonfm unless specifically requested +* (bug 18617) Add xml:space="preserve" attribute to relevant tags in XML output === Languages updated in 1.15 === diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 81bcfa7318..b6f726c5aa 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -89,6 +89,11 @@ class ApiFormatXml extends ApiFormatBase { if ($this->mDoubleQuote) $subElemContent = $this->doubleQuote($subElemContent); unset ($elemValue['*']); + + // Add xml:space="preserve" to the + // element so XML parsers will leave + // whitespace in the content alone + $elemValue['xml:space'] = 'preserve'; } else { $subElemContent = null; } -- 2.20.1