Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/celerity/CelerityResourceController.php
<?php | <?php | ||||
abstract class CelerityResourceController extends PhabricatorController { | abstract class CelerityResourceController extends PhabricatorController { | ||||
protected function buildResourceTransformer() { | protected function buildResourceTransformer() { | ||||
return null; | return null; | ||||
} | } | ||||
public function shouldRequireLogin() { | public function shouldRequireLogin() { | ||||
return false; | return false; | ||||
} | } | ||||
public function shouldRequireEnabledUser() { | public function shouldRequireEnabledUser() { | ||||
return false; | return false; | ||||
} | } | ||||
public function shouldAllowPartialSessions() { | |||||
return true; | |||||
} | |||||
abstract public function getCelerityResourceMap(); | abstract public function getCelerityResourceMap(); | ||||
protected function serveResource($path, $package_hash = null) { | protected function serveResource($path, $package_hash = null) { | ||||
// Sanity checking to keep this from exposing anything sensitive, since it | // Sanity checking to keep this from exposing anything sensitive, since it | ||||
// ultimately boils down to disk reads. | // ultimately boils down to disk reads. | ||||
if (preg_match('@(//|\.\.)@', $path)) { | if (preg_match('@(//|\.\.)@', $path)) { | ||||
return new Aphront400Response(); | return new Aphront400Response(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |