From 7f59bc0a9ca7450824f6bccf00db5d3392726d71 Mon Sep 17 00:00:00 2001 From: secretr Date: Sat, 10 Dec 2011 19:06:19 +0000 Subject: [PATCH] Plugin now can have new class bbcodes ('bb_*.php'). Potential plugin addons scan issue fixed. --- e107_handlers/plugin_class.php | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 8eedb7fd2..55c920c27 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1971,12 +1971,18 @@ class e107plugin } } - if ($is_installed && (substr($adds, -3) == ".bb")) - { - $bb_name = substr($adds, 0, -3); // remove the .bb - $bb_array[$bb_name] = "0"; // default userclass. - - } + if(substr($adds,-3) == ".bb") + { + $bb_name = substr($adds, 0,-3); // remove the .bb + $bb_array[$bb_name] = "0"; // default userclass. + } + // bbcode class + elseif(substr($adds, 0, 3) == "bb_" && substr($adds, -3) == ".bb") + { + $bb_name = substr($adds, 0,-3); // remove the .bb + $bb_name = substr($bb_name, 0, 3); + $bb_array[$bb_name] = "0"; // default userclass. TODO - instance and getPermissions() method + } if ($is_installed && (substr($adds, -4) == "_sql")) { @@ -2052,9 +2058,13 @@ class e107plugin } // Grab List of Shortcodes & BBcodes - $shortcodeList = $fl->get_files(e_PLUGIN.$plugin_path, ".sc$", "standard", 1); - $bbcodeList = $fl->get_files(e_PLUGIN.$plugin_path, ".bb$", "standard", 1); - $sqlList = $fl->get_files(e_PLUGIN.$plugin_path, "_sql.php$", "standard", 1); + $shortcodeList = $fl->get_files(e_PLUGIN.$plugin_path, '\.sc$', "standard", 1); + + $bbcodeList = $fl->get_files(e_PLUGIN.$plugin_path, '\.bb$', "standard", 1); + $bbcodeClassList= $fl->get_files(e_PLUGIN.$plugin_path, '^bb_(.*)\.php$', "standard", 1); + $bbcodeList = array_merge($bbcodeList, $bbcodeClassList); + + $sqlList = $fl->get_files(e_PLUGIN.$plugin_path, '_sql\.php$', "standard", 1); // Search Shortcodes foreach ($shortcodeList as $sc)