diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index e2b313f71..0ba21cea9 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -294,6 +294,11 @@ function GetChildren(&$vals, &$i) { } } + // remove double slahshes without breaking URI + protected function fixUri($string) { + return preg_replace('%([^:])([/]{2,})%', '\\1/', $string); + } + // Create recursive directories; begins at serendipity plugin root folder level function rmkdir($dir, $sub = 'plugins') { global $serendipity; @@ -877,7 +882,7 @@ function &buildTemplateList(&$tree) { $pluginstack[$i]['customIcon'] = '_spartacus'; // Remove the temporary $i reference, as the array should be associative and fix double slashes in url string - $pluginstack[$plugname] = str_replace('serendipity//', 'serendipity/', $pluginstack[$i]); + $pluginstack[$plugname] = $this->fixUri($pluginstack[$i]); unset($pluginstack[$i]); } }