From: <var...@us...> - 2010-06-01 13:58:07
|
Revision: 7458 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7458&view=rev Author: vargenau Date: 2010-06-01 13:58:01 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Present only allowed plugins Modified Paths: -------------- trunk/lib/EditToolbar.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2010-05-31 13:23:56 UTC (rev 7457) +++ trunk/lib/EditToolbar.php 2010-06-01 13:58:01 UTC (rev 7458) @@ -331,6 +331,7 @@ // result is cached. Esp. the args are expensive function pluginPulldown() { global $WikiTheme; + global $AllAllowedPlugins; $plugin_dir = 'lib/plugin'; if (defined('PHPWIKI_DIR')) @@ -345,18 +346,20 @@ $w = new WikiPluginLoader; foreach ($plugins as $plugin) { $pluginName = str_replace(".php", "", $plugin); - $p = $w->getPlugin($pluginName, false); // second arg? - // trap php files which aren't WikiPlugin~s - if (strtolower(substr(get_parent_class($p), 0, 10)) == 'wikiplugin') { - $plugin_args = ''; - $desc = $p->getArgumentsDescription(); - $src = array("\n",'"',"'",'|','[',']','\\'); - $replace = array('%0A','%22','%27','%7C','%5B','%5D','%5C'); - $desc = str_replace("<br />",' ',$desc->asXML()); - if ($desc) - $plugin_args = ' '.str_replace($src, $replace, $desc); - $toinsert = "%0A<<".$pluginName.$plugin_args.">>"; // args? - $plugin_js .= ",['$pluginName','$toinsert']"; + if (in_array($pluginName, $AllAllowedPlugins)) { + $p = $w->getPlugin($pluginName, false); // second arg? + // trap php files which aren't WikiPlugin~s + if (strtolower(substr(get_parent_class($p), 0, 10)) == 'wikiplugin') { + $plugin_args = ''; + $desc = $p->getArgumentsDescription(); + $src = array("\n",'"',"'",'|','[',']','\\'); + $replace = array('%0A','%22','%27','%7C','%5B','%5D','%5C'); + $desc = str_replace("<br />",' ',$desc->asXML()); + if ($desc) + $plugin_args = ' '.str_replace($src, $replace, $desc); + $toinsert = "%0A<<".$pluginName.$plugin_args.">>"; // args? + $plugin_js .= ",['$pluginName','$toinsert']"; + } } } $plugin_js = substr($plugin_js, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |