From: Roan Kattouw Date: Wed, 29 Apr 2009 13:12:27 +0000 (+0000) Subject: API: (bug 18617) Add xml:space="preserve" attribute to relevant tags in XML output... X-Git-Tag: 1.31.0-rc.0~41939 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=a4d055587e17b7434bf916a99aa2eebf0497a729;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; }