cvs: pear /Text_Wiki/Text/Wiki/Render Xhtml.php
| From: | bertrand GUGGER | Date: | Thu, 28 Jul 2005 10:59:26 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki/Render Xhtml.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33406@lists.php.net to get a copy of this message | ||
toggg Thu Jul 28 06:59:26 2005 EDT
Modified files:
/pear/Text_Wiki/Text/Wiki/Render Xhtml.php
Log:
A true test === for translate format conf is enough and works now !
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/Render/Xhtml.php?r1=1.6&r2=1.7&ty=u
Index: pear/Text_Wiki/Text/Wiki/Render/Xhtml.php
diff -u pear/Text_Wiki/Text/Wiki/Render/Xhtml.php:1.6 pear/Text_Wiki/Text/Wiki/Render/Xhtml.php:1.7
--- pear/Text_Wiki/Text/Wiki/Render/Xhtml.php:1.6 Mon May 30 09:37:47 2005
+++ pear/Text_Wiki/Text/Wiki/Render/Xhtml.php Thu Jul 28 06:59:23 2005
@@ -1,13 +1,13 @@
<?php
class Text_Wiki_Render_Xhtml extends Text_Wiki_Render {
-
+
var $conf = array(
'translate' => HTML_ENTITIES,
'quotes' => ENT_COMPAT,
'charset' => 'ISO-8859-1'
);
-
+
function pre()
{
// attempt to translate HTML entities in the source.
@@ -15,55 +15,55 @@
$type = $this->getConf('translate', HTML_ENTITIES);
$quotes = $this->getConf('quotes', ENT_COMPAT);
$charset = $this->getConf('charset', 'ISO-8859-1');
-
+
// have to check null and false because HTML_ENTITIES is a zero
- if ($type !== null && $type !== false && $type == HTML_ENTITIES) {
-
+ if ($type === HTML_ENTITIES) {
+
// keep a copy of the translated version of the delimiter
// so we can convert it back.
$new_delim = htmlentities($this->wiki->delim, $quotes, $charset);
-
+
// convert the entities. we silence the call here so that
- // errors about charsets don't pop up, per counsel from
+ // errors about charsets don't pop up, per counsel from
// Jan at Horde. (http://pear.php.net/bugs/bug.php?id=4474)
$this->wiki->source = @htmlentities(
$this->wiki->source,
$quotes,
$charset
);
-
+
// re-convert the delimiter
$this->wiki->source = str_replace(
$new_delim, $this->wiki->delim, $this->wiki->source
);
-
- } elseif ($type == HTML_SPECIALCHARS) {
-
+
+ } elseif ($type === HTML_SPECIALCHARS) {
+
// keep a copy of the translated version of the delimiter
// so we can convert it back.
$new_delim = htmlspecialchars($this->wiki->delim, $quotes,
$charset);
-
+
// convert the entities. we silence the call here so that
- // errors about charsets don't pop up, per counsel from
+ // errors about charsets don't pop up, per counsel from
// Jan at Horde. (http://pear.php.net/bugs/bug.php?id=4474)
$this->wiki->source = @htmlspecialchars(
$this->wiki->source,
$quotes,
$charset
);
-
+
// re-convert the delimiter
$this->wiki->source = str_replace(
$new_delim, $this->wiki->delim, $this->wiki->source
);
}
}
-
+
function post()
{
return;
}
-
+
}
-?>
\ No newline at end of file
+?>