is there a case where ``$vsite->purl_provider`` doesn't exist? - we can also move this one line up 

``if (($vsite = vsite_get_vsite()) &&  $vsite->purl_provider == 'vsite_domain') {``