Home » Text » Text_Wiki » Bug #843
Applying wiki rules a second time fails
Details
| Submitted | 2004-02-23 15:42 UTC |
|---|---|
| From | lasse at meldorf dot net |
| Assigned | pmjones |
| Status | Closed |
| Package | Text_Wiki |
| PHP Version | 4.3.3 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-02-23 15:42 UTC] lasse at meldorf dot net
Description:
------------
see headline
Problem is in Wiki.php:
function _loadRule($name, $file)
{
// load the class definition.
include_once($file);
// dynamically determine the name of the class
// we just loaded
$tmp = get_declared_classes();
$k = count($tmp) - 1;
$class = $tmp[$k];
unset($tmp);
// instantiate the rule object and add to the set
$this->_rule_obj[$name] =& new $class($this, $name);
}
Workaround: set
$class = "Text_Wiki_Rule_".$name;
Reproduce code:
---------------
<?php
require_once 'Text/Wiki.php';
$wiki = new Text_Wiki();
echo $wiki->transform( "<b>Text</b>")."<br>\n";
echo $wiki->transform( "<b>Text</b>")."<br>\n";
?>
Expected result:
----------------
<b>Text</b><br>
<b>Text</b><br>
Actual result:
--------------
<b>Text</b><br>
<b>Text</b><br>