Skip to content

Commit

Permalink
Dev: Check if status code is set before use
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 9, 2018
1 parent 913e78d commit c90db21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/core/LSYii_Application.php
Expand Up @@ -346,7 +346,8 @@ public function onException($event)
} else {
/* Here we have different possibility : maybe 400/401/403/404 with debug < 2 except for forced superadmin (currently : the 4 part don't show intersting information with debug*/
/* 500 always if debug and for (forced) superadmin even if no debug is set (and try to show complete error in this case (see issue by olle about white page and log */
if ((Yii::app()->getConfig('debug')<1 /* || Permission::hasGlobalPermission('superadmin') */) || $event->exception->statusCode=='404') {
if ((Yii::app()->getConfig('debug')<1 /* || Permission::hasGlobalPermission('superadmin') */)
|| (isset($event->exception->statusCode) && $event->exception->statusCode=='404')) {
Yii::app()->setComponent('errorHandler', array(
'errorAction'=>'surveys/error',
));
Expand Down

0 comments on commit c90db21

Please sign in to comment.