[Fusionforge-commits] FusionForge branch master updated. 7004616e727238568962ac59cf125ff55804fbaf

Alain Peyrat aljeux at fusionforge.org
Fri Dec 14 18:39:48 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  7004616e727238568962ac59cf125ff55804fbaf (commit)
      from  1769fcf80df96effc2a36dbd52f1c87541c36908 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7004616e727238568962ac59cf125ff55804fbaf
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Fri Dec 14 18:39:37 2012 +0100

    Do not call setcookie in cli mode, it breaks output

diff --git a/src/common/include/utils.php b/src/common/include/utils.php
index b5df32d..a3ea29c 100644
--- a/src/common/include/utils.php
+++ b/src/common/include/utils.php
@@ -1710,12 +1710,18 @@ function util_is_html($string) {
 function util_init_messages() {
 	global $feedback, $warning_msg, $error_msg;
 
-	$feedback = getStringFromCookie('feedback', '');
-	setcookie('feedback', '', time()-3600);
-	$warning_msg = getStringFromCookie('warning_msg', '');
-	setcookie('warning_msg', '', time()-3600);
-	$error_msg = getStringFromCookie('error_msg', '');
-	setcookie('error_msg', '', time()-3600);
+	if (PHP_SAPI == 'cli') {
+		$feedback = $warning_msg = $error_msg = '';
+	} else {
+		$feedback = getStringFromCookie('feedback', '');
+		if ($feedback) setcookie('feedback', '', time()-3600, '/');
+
+		$warning_msg = getStringFromCookie('warning_msg', '');
+		if ($warning_msg) setcookie('warning_msg', '', time()-3600, '/');
+
+		$error_msg = getStringFromCookie('error_msg', '');
+		if ($error_msg) setcookie('error_msg', '', time()-3600, '/');
+	}
 }
 
 function util_save_messages() {

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/utils.php |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list