cvs: phd /formats xhtml.php
| From: | Hannes Magnusson | Date: | Fri, 24 Aug 2007 09:10:21 +0000 |
| Subject: | cvs: phd /formats xhtml.php | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969377869@lists.php.net to get a copy of this message | ||
bjori Fri Aug 24 09:10:21 2007 UTC
Modified files:
/phd/formats xhtml.php
Log:
CDATA sections should escape special html chars and be wrapped in <pre />
# Lets all pretend this bug never existed and the html in CDATA sections
# was never executed by any browsers :P
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.18&r2=1.19&diff_format=u
Index: phd/formats/xhtml.php
diff -u phd/formats/xhtml.php:1.18 phd/formats/xhtml.php:1.19
--- phd/formats/xhtml.php:1.18 Sat Aug 18 22:52:11 2007
+++ phd/formats/xhtml.php Fri Aug 24 09:10:21 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: xhtml.php,v 1.18 2007/08/18 22:52:11 bjori Exp $ */
+/* $Id: xhtml.php,v 1.19 2007/08/24 09:10:21 bjori Exp $ */
class XHTMLPhDFormat extends PhDFormat {
protected $elementmap = array( /* {{{ */
@@ -183,7 +183,7 @@
return sprintf('<div class="phpcode">%s</div>',
highlight_string(trim($str), 1));
break;
default:
- return sprintf('<div class="cdata">%s</div>', $str);
+ return sprintf('<div
class="cdata"><pre>%s</pre></div>', htmlspecialchars($str,
ENT_QUOTES, "UTF-8"));
}
}
public function TEXT($str) {