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

ignorant urlEncode

Details

Request #7754ignorant urlEncode
Submitted2006-05-29 18:16 UTC
Fromnils at phoque dot de
StatusOpen
PackageText_Wiki
PHP VersionIrrelevant
OSWindows
Roadmaps(Not assigned)

Comments

[2006-05-29 18:16 UTC] nils at phoque dot de

Description:
------------
urlEncode does a rawurlencode even if in some situations some special characters (i.e. a slash) shouldn't be encoded.

Some option to "enable subpages" or a urlEncode-whitelist would be nice to fix this.

Test script:
---------------
not really necessary

Expected result:
----------------
<a href="page/subpage">subpage</a>

Actual result:
--------------
<a href="page%2Fsubpage">subpage</a>

[2006-05-31 11:04 UTC] nils at phoque dot de

It doesn't concearn Text_Wiki but Text_Wiki_Mediawiki wich uses Text_Wiki's urlEncode:

<?php
require_once 'Text/Wiki/Mediawiki.php';

$wiki = new Text_Wiki_Mediawiki;
$wiki->setRenderConf('xhtml', 'wikilink', 'pages', false);
$wiki->setRenderConf('xhtml', 'wikilink', 'view_url', '/%s/');

echo $wiki->transform("[[page/subpage|Subpage]]");
?>

[2006-05-31 12:01 UTC] ritzmo at php dot net

Actually it's not Text_Wiki_Mediawiki, which uses urlEncode but Text_Wiki.
The problem occuring is that there is no Class for Subpage-Links, so the used class is - correclty - still Wikilink.

So urlEncode happens in the Xhtml-Renderer and not in Mediawiki-Wikilink.
This problem obviously only occurs in the Mediawiki-Parser, as its the only one accepting Subpages.
So the question is if its better to remove the support of sub-pages in mediawiki or if its more logical to extend the Renderer.

[2006-06-14 10:39 UTC] nils at phoque dot de

Since Mediawiki itself accepts subpages (Wikipedia does only in the User:-namespace), I think it makes perfectly sense to enable Text_Wiki_Mediawiki to have subpages as well.

[2006-06-16 16:29 UTC] ritzmo at php dot net

Although I risk to repeat myself...

The discussion is not actually of enabling a feature in Text_Wiki_Mediawiki, but in Text_Wiki. So I'm reassigning this to Text_Wiki as I heard nothing from the devs about this issue and I'm not willing to remove support in Text_Wiki_Mediawiki without response.