bjori Sat Aug 11 16:42:07 2007 UTC
Modified files:
/phd build.php
/phd/formats xhtml.php
/phd/include PhDFormat.class.php
Log:
Each format has to escape special chars on its own
http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.15&r2=1.16&diff_format=u
Index: phd/build.php
diff -u phd/build.php:1.15 phd/build.php:1.16
--- phd/build.php:1.15 Fri Aug 10 20:16:13 2007
+++ phd/build.php Sat Aug 11 16:42:06 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: build.php,v 1.15 2007/08/10 20:16:13 bjori Exp $ */
+/* $Id: build.php,v 1.16 2007/08/11 16:42:06 bjori Exp $ */
function err($no, $str, $file, $line) {
global $notify;
@@ -171,7 +171,7 @@
}
}
if (count($skip) < count($themes)) {
- $retval = htmlspecialchars($value, ENT_QUOTES);
+ $retval = $format->TEXT($value);
foreach ($themes as $name => $theme) {
if (!in_array($name, $skip)) {
$theme->appendData($retval, false);
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.15&r2=1.16&diff_format=u
Index: phd/formats/xhtml.php
diff -u phd/formats/xhtml.php:1.15 phd/formats/xhtml.php:1.16
--- phd/formats/xhtml.php:1.15 Fri Aug 10 20:16:13 2007
+++ phd/formats/xhtml.php Sat Aug 11 16:42:06 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: xhtml.php,v 1.15 2007/08/10 20:16:13 bjori Exp $ */
+/* $Id: xhtml.php,v 1.16 2007/08/11 16:42:06 bjori Exp $ */
class XHTMLPhDFormat extends PhDFormat {
protected $elementmap = array( /* {{{ */
@@ -147,10 +147,6 @@
public function __construct(array $IDs) {
parent::__construct($IDs);
}
- /* Overwrite PhDFormat::readContent() to convert special HTML chars */
- public function readContent($content = null) {
- return htmlspecialchars(PhDFormat::readContent($content), ENT_QUOTES,
"UTF-8");
- }
public function __call($func, $args) {
if ($args[0]) {
trigger_error("No mapper found for '{$func}'", E_USER_WARNING);
@@ -173,6 +169,9 @@
return sprintf('<div class="cdata">%s</div>', $str);
}
}
+ public function TEXT($str) {
+ return htmlspecialchars($str, ENT_QUOTES, "UTF-8");
+ }
public function format_container_chunk($open, $name, $attrs) {
if ($open) {
http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.5&r2=1.6&diff_format=u
Index: phd/include/PhDFormat.class.php
diff -u phd/include/PhDFormat.class.php:1.5 phd/include/PhDFormat.class.php:1.6
--- phd/include/PhDFormat.class.php:1.5 Wed Aug 8 23:45:26 2007
+++ phd/include/PhDFormat.class.php Sat Aug 11 16:42:07 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: PhDFormat.class.php,v 1.5 2007/08/08 23:45:26 bjori Exp $ */
+/* $Id: PhDFormat.class.php,v 1.6 2007/08/11 16:42:07 bjori Exp $ */
abstract class PhDFormat extends PhDHelper {
private $TABLE = array();
@@ -7,6 +7,7 @@
/* abstract functions */
abstract public function transformFromMap($open, $tag, $name);
abstract public function CDATA($data);
+ abstract public function TEXT($data);
abstract public function __call($func, $args);
/* Table helper functions */