public static remove_double_slashes ( string $url ) : string | ||
$url | string | |
Résultat | string |
public static function remove_double_slashes($url)
{
$url = str_replace('//', '/', $url);
if (strstr($url, 'http:') && !strstr($url, 'http://')) {
$url = str_replace('http:/', 'http://', $url);
}
return $url;
}
/** * @internal * @param string $url */ protected function init_with_url($url) { $this->abs_url = $url; if (URLHelper::is_local($url)) { $this->file = URLHelper::remove_double_slashes(ABSPATH . URLHelper::get_rel_url($url)); $this->file_loc = URLHelper::remove_double_slashes(ABSPATH . URLHelper::get_rel_url($url)); } }