Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/site/PhabricatorResourceSite.php
<?php | <?php | ||||
final class PhabricatorResourceSite extends PhabricatorSite { | final class PhabricatorResourceSite extends PhabricatorSite { | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Serves static resources like images, CSS and JS.'); | return pht('Serves static resources like images, CSS and JS.'); | ||||
} | } | ||||
public function getPriority() { | public function getPriority() { | ||||
return 2000; | return 2000; | ||||
} | } | ||||
public function newSiteForRequest(AphrontRequest $request) { | public function newSiteForRequest(AphrontRequest $request) { | ||||
$host = $request->getHost(); | $host = $request->getHost(); | ||||
$uri = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); | $uri = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); | ||||
if (!strlen($uri)) { | if (!phutil_nonempty_string($uri)) { | ||||
return null; | return null; | ||||
} | } | ||||
if ($this->isHostMatch($host, array($uri))) { | if ($this->isHostMatch($host, array($uri))) { | ||||
return new PhabricatorResourceSite(); | return new PhabricatorResourceSite(); | ||||
} | } | ||||
return null; | return null; | ||||
Show All 16 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0