[dokuwiki] Re: base.php

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 17 Aug 2006 12:46:08 +0100

Gerry Weißbach wrote:

Hi there, hi Chris,

I think I found a bug in the /lib/plugins/base.php

there is

 function getPluginName() { list($t, $p, $n) = explode('_',
get_class($this), 4); return $n; }

but the class name consists of only three parts, thats why it should be

 function getPluginName() { list($t, $p, $n) = explode('_',
get_class($this), 3); return $n; }


otherwise plugins with an underscore in their name will not be working correctly. Can anyone please confirm that bug?


Gerry
Plugins shouldn't have underscores in their names. Plugins can consist of multiple components of the same type, e.g. the blog plugin, the code plugin. The class names for the components are constructed as:

<plugin_type>_plugin_<plugin name>_<component name>

e.g  syntax_plugin_blog_discussion

If you look at the line under the one you highlighted from lib/plugins/base.php you'll see that it returns the compontent name using a similar statement - only this time its the fourth component of the list(...).

Cheers,

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: