Skip to content

Commit

Permalink
fixed doubled slashes without breaking URI
Browse files Browse the repository at this point in the history
  • Loading branch information
ophian committed Dec 8, 2012
1 parent efd4d72 commit 9aebc99
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit 9aebc99

Please sign in to comment.