Active
Project:
Wiki
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Oct 2005 at 00:04 UTC
Updated:
8 Oct 2005 at 01:58 UTC
I'm using wiki module and it works, ok. Now I'm interesed in adding a feature to allow internal link (like /admin/settings) implemented. Ad far now if I use [ user registration | /user/register ] it is detected as wiki-named in the _wiki_parse_and_link function and the output is /wiki/goto/user/register (it don't works).
Now I suggest to introduce another elseif in the subroutine to detect $URL starting with a "/", then produce a regular link. So now the code:
if (preg_match("/\.".WIKI_INLINE_IMAGES."$/i", $URL)) {
// if it's an image, embed it; otherwise, it's a regular link
$link = array('type' => "image-$linktype", 'link' => _wiki_link_image($URL, $linkname));
}
// <internal link patch>
elseif (preg_match("#^/#", $URL)) {
$link = array('type' => "url-$linktype", 'link' => l($linkname, $URL));
}
// </internal link patch>
elseif (preg_match("#^".WIKI_ALLOWED_PROTOCOLS.":#", $URL)) {
$link = array('type' => "url-$linktype", 'link' => _wiki_link_URL($URL, $linkname));
}
Hoping it works.
ema
Comments
Comment #1
Neil Adair commentedDid you try the freelinking module?
Neil