Fix T38210: phabricator file downloads not working for non-logged in users.
This commit is contained in:
@@ -10,6 +10,10 @@ final class PhabricatorFileDataController extends PhabricatorFileController {
|
|||||||
$this->key = $data['key'];
|
$this->key = $data['key'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function shouldRequireLogin() {
|
public function shouldRequireLogin() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,10 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
|||||||
|
|
||||||
private $phid;
|
private $phid;
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function willProcessRequest(array $data) {
|
||||||
$this->phid = $data['phid'];
|
$this->phid = $data['phid'];
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ final class PhabricatorActionView extends AphrontView {
|
|||||||
* viewing.
|
* viewing.
|
||||||
*/
|
*/
|
||||||
public function getHref() {
|
public function getHref() {
|
||||||
if ($this->workflow || $this->renderAsForm) {
|
if (($this->workflow || $this->renderAsForm) && !$this->download) {
|
||||||
if (!$this->user || !$this->user->isLoggedIn()) {
|
if (!$this->user || !$this->user->isLoggedIn()) {
|
||||||
return id(new PhutilURI('/auth/start/'))
|
return id(new PhutilURI('/auth/start/'))
|
||||||
->setQueryParam('next', (string)$this->getObjectURI());
|
->setQueryParam('next', (string)$this->getObjectURI());
|
||||||
|
Reference in New Issue
Block a user