Home » Text » Text_Wiki » Bug #10114
Ruleset Case Sensitivity
Details
| Submitted | 2007-02-16 22:36 UTC |
|---|---|
| From | dev at edoceo dot com |
| Assigned | justinpatrin |
| Status | Closed |
| Package | Text_Wiki |
| PHP Version | 5.1.6 |
| OS | Gentoo Linux |
| Roadmaps | 1.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.