Function phpfreechat_load_params() is used to load the parameters to initiate a phpFreeChat chat, taking much of its data from the variables table, which got there from the data input through the phpFreeChat configuration form. One of the items is which proxies to skip, which is stored in the variable 'phpfreechat_skip_proxies'. The problem is that the 'skip_proxies' parameter needs to be an array of strings, and the current implementation of phpfreechat_load_params() assumes it (along with all the other variables) are single-valued. So, I made an alteration to the code of this function as commented below.
foreach ($settings as $setting) {
$value = variable_get('phpfreechat_'.$setting, '');
/*
if ($setting == 'timeout') {
if (empty($value) || $value < 35000) {
variable_set('phpfreechat_'.$setting, 35000);
$value = 35000;
}
}
*/
if (!empty($value)) {
if ($value == 'true') $params[$setting] = true;
else if ($value == 'false') $params[$setting] = false;
else if ($setting == 'skip_proxies') $params[$setting] = preg_split("/[\s,]+/", $value ); // added 2008-10-10 sdsheridan to take care of skip_proxies, which must be an array
else $params[$setting] = $value;
}
}
return $params;
}
The change accommodates the names of the proxies separated by commas and spaces. The reason I wanted this is to disable the 'censor' proxy, which by default, replaced three words with asterisks, one of them being 'sex', which frankly isn't such a bad work. So, if anyone else is experiencing this, and wants to change it, there's your fix.
I've not investigated what other parameters ought to be arrays of strings vs. single values, but there may be more.
NOTE that this applies to the 5.x-1.1b version, NOT the rc4 cited in the project information of this post... very unfortunately permutations who did some excellent work on this module has gone missing in action. It is her code upon which I have made this change. It might apply to the other versions too.
shawn
Comments
Comment #1
permutations commentedI'll take a look at this later in the week and add the fix, if needed. (The current code is now on Drupal - release version 1.2.)
Comment #2
permutations commentedComment #3
permutations commentedThis was a problem with all the array variables in the admin panel, not just skip_proxies. It's fixed for all but proxies_cfg (which is a multidimensional array) in v1.3, which I just uploaded. Details are in the release notes.
The other reason skip_proxies is good to be able to configure is that phpFreeChat 1.2 added a noflood feature with some hyper-aggressive parameters that normal chatting can trigger - very annoying. To turn this and the hyper-aggressive censorship off, use "censor,noflood" in skip_proxies.
And please note - very important:
Even if you fixed this particular problem in your own copy of the phpFreeChat module, you should download 1.3, which I just uploaded, because it contains another very important (though invisible) fix. My Web host temporarily disabled my MySQL account because of hugely long queries that threatened the stability of the shared server. This turned out to be an error in a part of the code I hadn't looked at too closely before. So please install v1.3 of the module.