*/
private static function verify_magic_envelope($envelope) {
- $basedom = parse_xml_string($envelope, false);
+ $basedom = parse_xml_string($envelope);
if (!is_object($basedom)) {
logger("Envelope is no XML file");
$decrypted = self::aes_decrypt($outer_key, $outer_iv, $ciphertext);
logger('decrypted: '.$decrypted, LOGGER_DEBUG);
- $idom = parse_xml_string($decrypted,false);
+ $idom = parse_xml_string($decrypted);
$inner_iv = base64_decode($idom->iv);
$inner_aes_key = base64_decode($idom->aes_key);
*/
private static function valid_posting($msg) {
- $data = parse_xml_string($msg["message"], false);
+ $data = parse_xml_string($msg["message"]);
if (!is_object($data)) {
logger("No valid XML ".$msg["message"], LOGGER_DEBUG);
return false;
}
- $source_xml = parse_xml_string($x, false);
+ $source_xml = parse_xml_string($x);
if (!is_object($source_xml))
return false;
}
-function parse_xml_string($s,$strict = true) {
+function parse_xml_string($s, $strict = true) {
+ // the "strict" parameter is deactivated
+
/// @todo Move this function to the xml class
- if ($strict) {
- if (! strstr($s,'<?xml'))
- return false;
- $s2 = substr($s,strpos($s,'<?xml'));
- }
- else
- $s2 = $s;
libxml_use_internal_errors(true);
- $x = @simplexml_load_string($s2);
- if (! $x) {
- logger('libxml: parse: error: ' . $s2, LOGGER_DATA);
+ $x = @simplexml_load_string($s);
+ if (!$x) {
+ logger('libxml: parse: error: ' . $s, LOGGER_DATA);
foreach (libxml_get_errors() as $err) {
logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
}