Home » Text » Text_Wiki » Bug #7094
Freelinks links appears urlencoded (Xhtml renderer)
Details
| Submitted | 2006-03-11 06:35 UTC |
|---|---|
| From | malbe at adinet dot com dot uy |
| Assigned | justinpatrin |
| Status | Closed |
| Package | Text_Wiki |
| PHP Version | 4.4.0 |
| OS | Linux 2.4.26 |
| Roadmaps | (Not assigned) |
Comments
[2006-03-11 06:35 UTC] malbe at adinet dot com dot uy
Description:
------------
If spaces are used in the text of a freelink (like "((This is a freelink))") AND new_text is set to null for the XHtml freelink rule, the resulting XHtml link will have it's text urlencoded.
Test script:
---------------
<?php
require_once 'PEAR.php';
require_once 'Text/Wiki.php';
$w = &Text_Wiki::singleton();
$w->setRenderConf('XHtml', 'Freelink', 'new_text', null);
$rawWiki = '((My freelink))';
$renderedContent = $w->transform($rawWiki);
print($renderedContent);
Expected result:
----------------
<p><a href="http://example.com/new.php?page=My%20freelink">My freelink</a></p>
Actual result:
--------------
<p><a href="http://example.com/new.php?page=My%20freelink">My%20freelink</a></p>
[2006-03-11 06:40 UTC] malbe at adinet dot com dot uy
Sorry, forgot to include possible patch:
diff Text/Wiki/Render/Xhtml/Wikilink.php Text/Wiki/Render/Xhtml/Wikilink_patched.php
152c152
< $text = $page;
---
> $text = $this->textEncode(rawurldecode($page));
And also forgot to say thanks for everything! :)