DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:linkprefix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:linkprefix [2014-06-10 16:51] – [Discussion] casperplugin:linkprefix [2023-10-30 23:36] (current) Klap-in
Line 1: Line 1:
-====== linkprefix plugin ======+====== linkprefix Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : dokuwiki@heiko-barth.de  email      : dokuwiki@heiko-barth.de 
 type       : renderer type       : renderer
-lastupdate : 2014-01-04 +lastupdate : 2019-01-02 
-compatible : 2009-12-25 "Lemming"2010-11-07 "Anteater"2011-05-25 "Rincewind"2012-01-25 "Angua"2012-10-13 "Adora Belle"2013-03-06, 2013-05-10 "Weatherwax"2013-12-08 "Binky"+compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick Manners, Greebo
 depends    :  depends    : 
 conflicts  conflicts 
-similar    :  +similar    : refererremove 
-tags       : remove referer, modify, links+tags       : links, referer, privacy
  
-downloadurl: http://www.heiko-barth.de/downloads/dw_linkprefix.zip+downloadurl: https://github.com/casperklein/dokuwiki_plugin_linkprefix/zipball/master 
 +sourcerepo : https://github.com/casperklein/dokuwiki_plugin_linkprefix/ 
 +bugtracker : https://github.com/casperklein/dokuwiki_plugin_linkprefix/issues
 ---- ----
  
Line 24: Line 26:
 ===== Updates ===== ===== Updates =====
  
 +  * 2019-01-02: PHP7 compatibility (thanks Dwight Donovan Benvenuto)
 +  * 2017-10-06: Fix external dereferer (thanks Doobry)
 +  * 2015-09-10: Bug fixes (thanks Christoph).
 +  * 2015-08-20: Code optimized.
   * 2014-01-04: An option to ignore URLs pointing to the same domain where dokuwiki is running added. (enabled by default)   * 2014-01-04: An option to ignore URLs pointing to the same domain where dokuwiki is running added. (enabled by default)
-  * 2013-11-12: Replaced PHP short open tag with ''<?php'' (thanks Richard)+  * 2013-11-12: Replaced PHP short open tag with ''<?php'' (thanks Richard).
   * 2013-05-12: Removed Java-Script, switched to HTML5.   * 2013-05-12: Removed Java-Script, switched to HTML5.
   * 2010-03-28: Support for interwiki links added.   * 2010-03-28: Support for interwiki links added.
Line 31: Line 37:
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Configuration ===== ===== Configuration =====
Line 45: Line 51:
 ===== Discussion ===== ===== Discussion =====
  
-So nobody complains anything, I guess everything works fine with this plugin :o)+<del>So nobody complains anything, I guess everything works fine with this plugin :o)</del>
  
 +===== Open Bugs =====
 +
 +  * Doesnt work on the Docs links in the extension manager
 +
 +===== Fixed Bugs =====
  
 I don't think so. I've added the plugin, but it doesn't seem to work. In the Sourcecode there is still no thing like "http://anonym.to?". Im using Angua. Is there any reset to trigger? THX I don't think so. I've added the plugin, but it doesn't seem to work. In the Sourcecode there is still no thing like "http://anonym.to?". Im using Angua. Is there any reset to trigger? THX
  
 > Did you change the ''renderer_xhtml'' option in your configuration? Please read the complete instruction above. > Did you change the ''renderer_xhtml'' option in your configuration? Please read the complete instruction above.
->  --- Casper //2014/02/05 00:14//+>  --- Heiko //2014/02/05 00:14//
  
 Thanks, worked. I thought the renderer_xhtml was the option provided by the plugin itself. Sorry, my bad. Thanks, worked. I thought the renderer_xhtml was the option provided by the plugin itself. Sorry, my bad.
Line 58: Line 69:
 Hi, I added this plugin and it almost worked right away. The only quirk is that I had to add '<?php' to the beginning of redirect.php, where it only started with '<?'. It refuses to render with only '<?' on my server. Hi, I added this plugin and it almost worked right away. The only quirk is that I had to add '<?php' to the beginning of redirect.php, where it only started with '<?'. It refuses to render with only '<?' on my server.
  
-> Thanks for reporting. I'll fix that asap.  --- Casper //2014-06-10 16:50//+> Thanks for reporting. I'll fix that asap.  --- Heiko //2014-06-10 16:50// 
 + 
 +==== Wrongly affects other protocols ==== 
 + 
 +I enabled the file:%%//%% scheme according to  [[this>urlschemes|urlschemes]] and configured firefox to allow local links from my dokuwiki instance. Unfortunately the linkprefixplugin gets in the way and changes the URI from e.g.\\ ''%%file:///usr%%''\\ to\\ ''%%http://wiki/lib/plugins/linkprefix/redirect.php?file%3A%2F%2F%2Fusr%%''
 +When I checked the other protocols I found they're affected, too.((For Testing:\\ [[http://test]]\\ [[https://test]]\\ [[telnet://test]]\\ [[gopher://test]]\\ [[wais://test]]\\ [[ftp://test]]\\ [[ed2k://test]]\\ [[irc://test]]\\ [[ldap://test]]\\ [[file://test]])) 
 + 
 +I guess this is unintented behaviour and should probably be fixed. 
 +> Fixed.  --- Heiko //2015-09-10 03:00// 
 + 
 +==== Interwiki-Links ==== 
 +If one uses more than one [[:Interwiki]] link in a row only the first one will work.\\ 
 +Example: 
 +  [[doku>tips|Working]] 
 +  [[doku>tips|Broken]] 
 +  [[doku>tips|Broken]] 
 +I'm (also previous bug report) using the 2014-09-29d "Hrun" release, but for the plugin this shouldnt matter, should it? 
 +> Fixed.  --- Heiko //2015-09-10 03:00// 
 + 
 +==== External Dereferer ==== 
 + 
 +Seems like the plugin is broken with external dereferers. It always prefixes the URL with  $_SERVER["HTTP_HOST"] which doesn't make sense for external dereferers. Also, some external dereferers don't expect urlencoded URLs. Thus the following change was necessary (which in turn breaks the plugin for the internal dereferer): 
 + 
 +<code> 
 +-               $url    = $protocol . "://" . $_SERVER["HTTP_HOST"] . $this->getConf('prefix') . urlencode($url); 
 ++               // Plugin was broken with external dereferer: 
 ++               // * prefix of $_SERVER["HTTP_HOST"] doesn't make sense with 
 ++               //   an external dereferer 
 ++               // * our dereferer doesn't like urlencoded URLs 
 ++               //$url  = $protocol . "://" . $_SERVER["HTTP_HOST"] . $this->getConf('prefix') . urlencode($url); 
 ++               $url    = $this->getConf('prefix') . $url; 
 +</code> 
 + 
 +> You are right, $_SERVER["HTTP_HOST"] makes absolutely no sense :) I will fix that and provide an option to disable URL encoding.  --- Heiko //2017-09-26 00:09//
plugin/linkprefix.1402411903.txt.gz · Last modified: 2014-06-10 16:51 by casper

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki