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 #7094

Freelinks links appears urlencoded (Xhtml renderer)

Details

Submitted2006-03-11 06:35 UTC
Frommalbe at adinet dot com dot uy
Assignedjustinpatrin
StatusClosed
PackageText_Wiki
PHP Version4.4.0
OSLinux 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! :)