Craft\Minimee_BaseAssetModel::removeDoubleSlashes PHP Method

removeDoubleSlashes() protected method

If the string passed is a URL, it will preserve leading double slashes
protected removeDoubleSlashes ( $string, $url = FALSE ) : string
return string String without double slashes
    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);
        }
    }