php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32457 xml_parse_into_struct stops short without error if xml attributes are unquoted
Submitted: 2005-03-25 19:05 UTC Modified: 2005-03-25 19:57 UTC
From: cephalicmarble at blueyonder dot co dot uk Assigned:
Status: Not a bug Package: XML related
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
 [2005-03-25 19:05 UTC] cephalicmarble at blueyonder dot co dot uk
Description:
------------
xml_parse_into_struct returns nodes correctly until it encounters an unquoted attribute. The function bombs without error.

Reproduce code:
---------------
<?php
$sample =
  "<?xml version=\"1.0\"?><doc><test attr=unquoted/><next/><again/></doc>";
$parser = xml_parser_create();
$res = xml_parse_into_struct($parser,$sample,$vals,$index);
xml_parser_free($parser);
//var_dump($vals); 
echo sizeof($vals);
?>


Expected result:
----------------
sizeof($vals) is one. Quote the attribute and it should be 5.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-25 19:57 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

check return and error values
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC