Piwik\Plugins\SitesManager\API::removeTrailingSlash PHP Method

removeTrailingSlash() private method

Remove the final slash in the URLs if found
private removeTrailingSlash ( string $url ) : string
$url string
return string the URL without the trailing slash
    private function removeTrailingSlash($url)
    {
        // if there is a final slash, we take the URL without this slash (expected URL format)
        if (strlen($url) > 5 && $url[strlen($url) - 1] == '/') {
            $url = substr($url, 0, strlen($url) - 1);
        }
        return $url;
    }