PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Wiki » Bug #10114

Ruleset Case Sensitivity

Details

Submitted2007-02-16 22:36 UTC
Fromdev at edoceo dot com
Assignedjustinpatrin
StatusClosed
PackageText_Wiki
PHP Version5.1.6
OSGentoo Linux
Roadmaps1.2.0

Comments

[2007-02-16 22:36 UTC] dev at edoceo dot com

Description:
------------
The rule names in the documentation show usage in lower case but then when the code is running it's referenced in Upper case.

Like this:

$rules = array('anchor','emphasis','heading','list','newline','paragraph','table','toc','tt','url');
$wiki = new Text_Wiki($rules);

Well in Wiki->parse around like 930ish is this snip

if (is_object($this->parseObj[$name]))

And if one looks into the parseObj array you'll find all the names with Uppercase First Letters so when looking for rule 'anchor' it don't find 'Anchor'

Test script:
---------------
$rules = array('anchor','heading','list','newline','paragraph','table','toc','url');
$wiki = new Text_Wiki($rules);

$xhtml = $wiki->transform($note->data,'Xhtml');
echo "$xhtml";

Expected result:
----------------
Expected to render with no issue.

Actual result:
--------------
Error: #8 - Undefined index: anchor
File: /usr/share/php/Text/Wiki.php [931]

I addeed

$name = ucfirst($name)

at line 922 as a quick fix.