|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30455 Livedocs strips HTML comments from source
Submitted: 2004-10-16 07:02 UTC Modified: 2005-02-09 20:47 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned: ilia (profile)
Status: Closed Package: Livedocs problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2004-10-16 07:02 UTC]
Livedocs strips comments from files, which is a problem if you want to add comments to HTML blocks in CDATA.

This is the offending line:


/* strip comments */
$data = preg_replace('@<!--\s+.*\s-->@Usm', '', $data);

I'm not sure why this needs to be done, but perhaps it can be removed or improved.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-16 09:11 UTC]
Yes, those lines can be removed safely.
 [2004-11-13 19:05 UTC] smileaf at ryalth dot com
stripping comments can be a problem if your wanting to use the w3c recommendation to comment script data out for older browsers. 
I'm experiencing this with php 5.0.2 using xsltprocessor
 [2005-02-09 20:47 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 23:01:24 2023 UTC