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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cephalicmarble at blueyonder dot co dot uk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 07:01:33 2025 UTC