To create a new cookbook entry, fill in or remove the sections below.
The goal of this add-on is to replace external urls by an obfuscated form. This should avoid/limit spam on wiki pages: the url won't appear in the page
The FmtUrlLink function is replaced. Each link is replaced by a string made of the hexadecimal value of each characters of the urls. Then the url is replaced by a redirection script able to decode this string.
for example, on my wiki, the following link:
is replaced by:
- Copy the hide_external_link.php file into yout local directory. Copy the redirect.php script to a place where it is accessible (your pmwiki directory).
- Edit your local/config.php file, add the following lines:
$UrlWhiteList = 'www.your.site.web'; $UrlWhiteList = 'www.othersite'; $UrlWhiteList = 'www.pmwiki.org'; $UrlWhiteList = 'www.pmichaud.com'; $RedirectionScriptUrl='[(approve links) edit diff]'; include_once("local/hide_external_links.php");
- the UrlWhiteList array contains names of website that should not be obfuscated.
- $redirectionScriptUrl is the url of the redirection script
- 18 June 2004: Creation
- 18 June 2004: 2nd version, no more modification to pmwiki.php is needed
- 21 June 2004: Compacter url coding used
Comments & Bugs
- TODO: The white list could be loaded from a file or better, a wiki page.
- BUG: ?? Some of the links being obfuscated are having their last letter changed.
from IP: 126.96.36.199 ip should be disabled by default for security reasons