@zerkms, so, should sanitize it always no?, not only in this if statement no?
i think this trim (or rtrim) should be done when the $url is setted at the first time:
$url = rtrim($this->info['url'], '/');