[Phpfreechat-svn] SF.net SVN: phpfreechat: [850] trunk/src/pfcglobalconfig.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-29 11:20:59
|
Revision: 850 http://svn.sourceforge.net/phpfreechat/?rev=850&view=rev Author: kerphi Date: 2006-10-29 03:20:55 -0800 (Sun, 29 Oct 2006) Log Message: ----------- Bug fix : fix an intilite loop when 'frozen_nick' is true and 'nick' length is > 'max_nick_len' Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-10-29 10:42:05 UTC (rev 849) +++ trunk/src/pfcglobalconfig.class.php 2006-10-29 11:20:55 UTC (rev 850) @@ -204,6 +204,11 @@ // now load or save the configuration in the cache $this->synchronizeWithCache(); + + // This is a dirty workaround which fix a infinite loop when: + // 'frozen_nick' is true + // 'nick' length is > 'max_nick_len' + $this->nick = $this->filterNickname($this->nick); } function &Instance( $params = array() ) @@ -596,6 +601,14 @@ else die(_pfc("Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct", $file, $this->themepath, $this->theme)); } + + function filterNickname($nickname) + { + $nickname = trim($nickname); + require_once dirname(__FILE__)."/../lib/utf8/utf8_substr.php"; + $nickname = utf8_substr($nickname, 0, $this->max_nick_len); + return $nickname; + } } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |