protected function removeDoubleSlashes($string, $url = FALSE)
{
// is our string a URL?
if ($url) {
// regex pattern removes all double slashes, preserving http:// and '//' at start
return preg_replace("#([^:])//+#", "\\1/", $string);
} else {
// regex pattern removes all double slashes - straight from EE->functions->remove_double_slashes();
return preg_replace("#(^|[^:])//+#", "\\1/", $string);
}
}