Fixes #6318: Incorrect whitespace handling/parsing of XML documents

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8158 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2009-04-28 13:23:37 +00:00
parent c8cf1a2c5b
commit 9f15226e46
2 changed files with 26 additions and 1 deletions

View file

@ -880,10 +880,11 @@ class Xml extends XmlNode {
*/
function parse() {
$this->__initParser();
$this->__rawData = trim($this->__rawData);
$this->__header = trim(str_replace(
a('<' . '?', '?' . '>'),
a('', ''),
substr(trim($this->__rawData), 0, strpos($this->__rawData, "\n"))
substr($this->__rawData, 0, strpos($this->__rawData, '?' . '>'))
));
xml_parse_into_struct($this->__parser, $this->__rawData, $vals);