1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02: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:
Bob Trahan 2012-11-19 17:05:10 -08:00
parent 1578986590
commit 1e743c9138

View file

@ -95,19 +95,19 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
require_celerity_resource('phabricator-core-buttons-css');
require_celerity_resource('phabricator-standard-page-view');
Javelin::initBehavior('workflow', array());
$current_token = null;
$request = $this->getRequest();
if ($request) {
$user = $request->getUser();
if ($user) {
$current_token = $user->getCSRFToken();
}
}
Javelin::initBehavior('workflow', array());
$download_form = phabricator_render_form_magic($user);
$default_img_uri =
PhabricatorEnv::getCDNURI('/rsrc/image/icon/fatcow/document_black.png');
PhabricatorEnv::getCDNURI(
'/rsrc/image/icon/fatcow/document_black.png'
);
Javelin::initBehavior(
'lightbox-attachments',
@ -115,6 +115,9 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
'defaultImageUri' => $default_img_uri,
'downloadForm' => $download_form,
));
}
}
Javelin::initBehavior('toggle-class', array());
Javelin::initBehavior('konami', array());
Javelin::initBehavior(