php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30746 simplexml_load_file fails if the data contains the '&' or '<' or '>' character
Submitted: 2004-11-10 14:13 UTC Modified: 2004-11-10 14:25 UTC
From: manoj_smartsoft at rediffmail dot com Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 5.0.2 OS: Windows-XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: manoj_smartsoft at rediffmail dot com
New email:
PHP Version: OS:

 

 [2004-11-10 14:13 UTC] manoj_smartsoft at rediffmail dot com
Description:
------------
If the XML file conatinx &,< or > in the data field, then the simplexml_load_file fails

Reproduce code:
---------------
// * bug_file.xml : START * //
<?xml version='1.0' standalone='yes'?>
<couples>
<couple>
   <name>John&Marry</name>
   <age>John>Marry</age>
</couple>
</couples>

// * bug_file.xml : END * //
<?php

$xml = simplexml_load_file("bug_file.xml");

echo $xml->couple[0]->name; // "So this language. It's ike..."
?> 

Expected result:
----------------
This should give me the following result

John&Marry

Actual result:
--------------
The actual result is that, the function returns error.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-10 14:25 UTC] manoj_smartsoft at rediffmail dot com
To avoid this use the ascii values

go to http://webdesign.about.com/library/bl_htmlcodes.htm
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Dec 07 22:03:34 2021 UTC