php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30440 Nested entities cause invalid XML
Submitted: 2004-10-15 06:56 UTC Modified: 2005-06-21 04:01 UTC
From: sean@php.net Assigned: iliaa (profile)
Status: Not a bug Package: Livedocs problem
PHP Version: Irrelevant OS: n/a
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: sean@php.net
New email:
PHP Version: OS:

 

 [2004-10-15 06:56 UTC] sean@php.net
Description:
------------
When an entity contains a nested (special character) entity, the handler is not called properly, and this can result in malformed XML.

I worked on this for about 30 mins, tonight, and didn't get very far, so no patch, yet.

Reproduce code:
---------------
http://livedocs.phpdoc.info/ref.regex

Expected result:
----------------
<ulink url="http://www.tin.org/bin/man.cgi?section=7&topic=regex">

Actual result:
--------------
<ulink url="http://www.tin.org/bin/man.cgi?section=7<phpdoc_include ref="amp"/>topic=regex">

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-15 17:44 UTC] nlopess@php.net
That should be fixed with one of my patches: http://livedocs.aborla.net/patch.php?id=entities
 [2004-10-15 17:54 UTC] sean@php.net
Confirmed that this patch fixes this problem.

Could someone with the necessary karma please patch & commit?

Thanks,
S
 [2005-04-20 20:37 UTC] jsgoupil@php.net
I applied the patch and with French doc there are a lot of accents... (? ? ...)
I got only a Warning (the page is displayed but crash only at the special character) :

XML: 1:33 Invalid character Line: 1 is <div><div class="function_link"><function>pg_affected_rows</function> - Retourne le nombre de lignes affect?es</div>

<div><div class="function_link"><function>pg_affected_rows</function> - Retourne le nombre de lignes affect?es</div>
<div class="function_link"><function>pg_cancel_query</function> - Annule une requ?te asynchrone</div>
...


It seems that it is only for displaying functions at the end of a reference.xml file
Example : fr/ref.pgsql.html
 [2005-06-18 04:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2005-06-20 17:19 UTC] jsgoupil@php.net
I have still the same errors... Do I have to apply the patch again ?
 [2005-06-21 04:01 UTC] iliaa@php.net
The parser expects charset of the XML files to be UTF-8, for the French translation it is ISO-8859-1. To solve many of the errors in parsing, modify mkindex.php and change 
xml_parser_create("UTF-8");
to
xml_parser_create("ISO-8859-1");

This is not a livedocs bug, as the input should technically be UTF-8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 05:01:27 2024 UTC