PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Text » Text_Wiki » Bug #843

Applying wiki rules a second time fails

Details

Submitted2004-02-23 15:42 UTC
Fromlasse at meldorf dot net
Assignedpmjones
StatusClosed
PackageText_Wiki
PHP Version4.3.3
OSLinux
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>