From 281d70ac2d4a90c0300a5341678eeba6b7e43578 Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 8 Jul 2005 03:51:38 +0000 Subject: [PATCH] Merging from STABLE: Three improvements: 1. $nomoodlecookie = true. I just found out about this undocumented(?) hack(?) in lib/setup.php which is the perfect way to suppress some warnings. We don't need a session cookie for the chatd. 2. If allow_call_time_pass_reference is Off, socket_getpeername can't work. 3. Suppress "call time pass by reference is deprecated" messages for socket_getpeername, we don't have any choice here. --- mod/chat/chatd.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod/chat/chatd.php b/mod/chat/chatd.php index 471c09af4a9..bb41bf9e8af 100755 --- a/mod/chat/chatd.php +++ b/mod/chat/chatd.php @@ -27,6 +27,8 @@ $_SERVER['PHP_SELF'] = 'dummy'; $_SERVER['SERVER_NAME'] = 'dummy'; $_SERVER['HTTP_USER_AGENT'] = 'dummy'; +$nomoodlecookie = true; + include('../../config.php'); include('lib.php'); @@ -42,6 +44,10 @@ if(!empty($safemode)) { die("Error: Cannot run with PHP safe_mode = On. Turn off safe_mode in php.ini.\n"); } +if(ini_get('allow_call_time_pass_reference') == '0') { + die("Error: Cannot run with PHP allow_call_time_pass_reference = Off. Turn on allow_call_time_pass_reference in php.ini.\n"); +} + @set_time_limit (0); set_magic_quotes_runtime(0); error_reporting(E_ALL); @@ -65,7 +71,7 @@ class ChatConnection { function ChatConnection($resource) { $this->handle = $resource; - socket_getpeername($this->handle, &$this->ip, &$this->port); + @socket_getpeername($this->handle, &$this->ip, &$this->port); } }