From 23c4d052c7ea610f815f8bd5ee22f3be00325893 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 30 Jul 2015 07:15:19 +0000 Subject: [PATCH] Fix errors in async service, since r53254 "run shutdown callbacks after sending output to user" --- phpgwapi/inc/class.egw.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 77c2f220d1..6eb7b283d6 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -591,7 +591,7 @@ class egw extends egw_minimal } // now we can close the session // without closing the session fastcgi_finish_request() will NOT send output to user - $GLOBALS['egw']->session->commit_session(); + if (isset($GLOBALS['egw']->session)) $GLOBALS['egw']->session->commit_session(); // flush all output to user /* does NOT work on Apache :-( @@ -601,7 +601,7 @@ class egw extends egw_minimal } flush();*/ // working for fastCGI :-) - if (function_exists('fastcgi_finish_request')) + if (function_exists('fastcgi_finish_request') && substr($_SERVER['PHP_SELF'], -32) != '/phpgwapi/cron/asyncservices.php') { fastcgi_finish_request(); }