[Phpfreechat-svn] SF.net SVN: phpfreechat: [626] trunk/src/pfcglobalconfig.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-25 20:32:03
|
Revision: 626 Author: kerphi Date: 2006-06-25 13:31:55 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=626&view=rev Log Message: ----------- check if the 'channels' parameter value is really an array of strings Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-24 20:09:32 UTC (rev 625) +++ trunk/src/pfcglobalconfig.class.php 2006-06-25 20:31:55 UTC (rev 626) @@ -175,7 +175,7 @@ if ($this->xajaxpath == "") $this->xajaxpath = dirname(__FILE__)."/../lib/xajax_0.2.3"; if ($this->jspath == "") $this->jspath = dirname(__FILE__)."/../lib/javascript"; if ($this->csstidypath == "") $this->csstidypath = dirname(__FILE__)."/../lib/csstidy-1.1"; - if (count($this->channels) == 0) $this->channels = array(_pfc("My room")); + if (is_array($this->channels) && count($this->channels) == 0) $this->channels = array(_pfc("My room")); // first of all, check the used functions $f_list["file_get_contents"] = _pfc("You need %s", "PHP 4 >= 4.3.0 or PHP 5"); @@ -313,7 +313,17 @@ // check the serverid is really defined if ($this->serverid == "") $this->errors[] = _pfc("'%s' parameter is mandatory by default use '%s' value", "serverid", "md5(__FILE__)"); - + + // check if channels parameter is a strings array + if (!is_array($this->channels)) + $this->errors[] = _pfc("'%s' parameter must be an array", "channels"); + else + foreach($this->channels as $chan) + { + if (!is_string($chan)) + $this->errors[] = _pfc("'%s' value must be a string", serialize($chan)); + } + // check the max_msg is >= 0 if (!is_numeric($this->max_msg) || $this->max_msg < 0) $this->errors[] = _pfc("'%s' parameter must be a positive number", "max_msg"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |