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.
This commit is contained in:
+7
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user