From 1b2eb1bd5843ac60bc31dfddb0e9d02d23cd6169 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 7 Oct 2009 16:21:12 +0000 Subject: handle blanks before _p['encoding'] . '"?>' . $head; $result = xml_parse($parser, $head, false); @@ -85,6 +85,7 @@ function from_xml($xmldata, $p) { # Add header for charset detection (PHP5) if no header/BOM # See http://www.w3.org/TR/2006/REC-xml-20060816/#sec-guessing + $xmldata = trim($xmldata); if (!preg_match('/^(<\?xml|\xEF\xBB\xBF|\xFE\xFF|\xFF\xFE|\x00\x00\xFE\xFF|\x00\x00\xFF\xFE)/', $xmldata)) $xmldata = '_p['encoding'] . '"?>' . $xmldata; -- cgit v1.2.3