Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.
  • Loading branch information...
commit df1cbe9f48de0e83f2f21ff5dd8df970742b2449 1 parent a26a0e2
defacer authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 mod/chat/chatd.php
8 mod/chat/chatd.php
@@ -27,6 +27,8 @@
27 27 $_SERVER['SERVER_NAME'] = 'dummy';
28 28 $_SERVER['HTTP_USER_AGENT'] = 'dummy';
29 29
  30 +$nomoodlecookie = true;
  31 +
30 32 include('../../config.php');
31 33 include('lib.php');
32 34
@@ -42,6 +44,10 @@
42 44 die("Error: Cannot run with PHP safe_mode = On. Turn off safe_mode in php.ini.\n");
43 45 }
44 46
  47 +if(ini_get('allow_call_time_pass_reference') == '0') {
  48 + die("Error: Cannot run with PHP allow_call_time_pass_reference = Off. Turn on allow_call_time_pass_reference in php.ini.\n");
  49 +}
  50 +
45 51 @set_time_limit (0);
46 52 set_magic_quotes_runtime(0);
47 53 error_reporting(E_ALL);
@@ -65,7 +71,7 @@ class ChatConnection {
65 71
66 72 function ChatConnection($resource) {
67 73 $this->handle = $resource;
68   - socket_getpeername($this->handle, &$this->ip, &$this->port);
  74 + @socket_getpeername($this->handle, &$this->ip, &$this->port);
69 75 }
70 76 }
71 77

0 comments on commit df1cbe9

Please sign in to comment.
Something went wrong with that request. Please try again.