mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 19:31:02 +01:00
fix lightbox for when we have no $user or $request
Summary: defensive program wins all battles Test Plan: lightbox still worked Reviewers: vrana, epriestley Reviewed By: vrana CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3975
This commit is contained in:
parent
1578986590
commit
1e743c9138
1 changed files with 14 additions and 11 deletions
|
@ -95,26 +95,29 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||||
require_celerity_resource('phabricator-core-buttons-css');
|
require_celerity_resource('phabricator-core-buttons-css');
|
||||||
require_celerity_resource('phabricator-standard-page-view');
|
require_celerity_resource('phabricator-standard-page-view');
|
||||||
|
|
||||||
|
Javelin::initBehavior('workflow', array());
|
||||||
|
|
||||||
$current_token = null;
|
$current_token = null;
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
if ($request) {
|
if ($request) {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$current_token = $user->getCSRFToken();
|
$current_token = $user->getCSRFToken();
|
||||||
|
$download_form = phabricator_render_form_magic($user);
|
||||||
|
$default_img_uri =
|
||||||
|
PhabricatorEnv::getCDNURI(
|
||||||
|
'/rsrc/image/icon/fatcow/document_black.png'
|
||||||
|
);
|
||||||
|
|
||||||
|
Javelin::initBehavior(
|
||||||
|
'lightbox-attachments',
|
||||||
|
array(
|
||||||
|
'defaultImageUri' => $default_img_uri,
|
||||||
|
'downloadForm' => $download_form,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Javelin::initBehavior('workflow', array());
|
|
||||||
$download_form = phabricator_render_form_magic($user);
|
|
||||||
$default_img_uri =
|
|
||||||
PhabricatorEnv::getCDNURI('/rsrc/image/icon/fatcow/document_black.png');
|
|
||||||
|
|
||||||
Javelin::initBehavior(
|
|
||||||
'lightbox-attachments',
|
|
||||||
array(
|
|
||||||
'defaultImageUri' => $default_img_uri,
|
|
||||||
'downloadForm' => $download_form,
|
|
||||||
));
|
|
||||||
Javelin::initBehavior('toggle-class', array());
|
Javelin::initBehavior('toggle-class', array());
|
||||||
Javelin::initBehavior('konami', array());
|
Javelin::initBehavior('konami', array());
|
||||||
Javelin::initBehavior(
|
Javelin::initBehavior(
|
||||||
|
|
Loading…
Reference in a new issue