function includePlugin($name, $pluginPath = '') {
global $serendipity;
+ if (empty($pluginPath)) {
+ $pluginPath = $name;
+ }
+
// First try the local path, and then (if existing) a shared library repository ...
if (file_exists($serendipity['serendipityPath'] . 'plugins/' . $pluginPath . '/' . $name . '.php')) {
- include $serendipity['serendipityPath'] . 'plugins/' . $pluginPath . '/' . $name . '.php';
+ include_once $serendipity['serendipityPath'] . 'plugins/' . $pluginPath . '/' . $name . '.php';
} elseif (file_exists(S9Y_INCLUDE_PATH . 'plugins/' . $pluginPath . '/' . $name . '.php')) {
- include S9Y_INCLUDE_PATH . 'plugins/' . $pluginPath . '/' . $name . '.php';
+ include_once S9Y_INCLUDE_PATH . 'plugins/' . $pluginPath . '/' . $name . '.php';
}
}