[Phpfreechat-svn] SF.net SVN: phpfreechat: [750] trunk/src/commands/me.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-09-11 11:55:58
|
Revision: 750 http://svn.sourceforge.net/phpfreechat/?rev=750&view=rev Author: kerphi Date: 2006-09-11 04:55:53 -0700 (Mon, 11 Sep 2006) Log Message: ----------- add a check for missing parameters Modified Paths: -------------- trunk/src/commands/me.class.php Modified: trunk/src/commands/me.class.php =================================================================== --- trunk/src/commands/me.class.php 2006-09-11 11:17:57 UTC (rev 749) +++ trunk/src/commands/me.class.php 2006-09-11 11:55:53 UTC (rev 750) @@ -4,6 +4,8 @@ class pfcCommand_me extends pfcCommand { + var $usage = "/me {message}"; + function run(&$xml_reponse, $p) { $clientid = $p["clientid"]; @@ -15,6 +17,17 @@ $c =& $this->c; $u =& $this->u; + if (trim($param) == "") + { + // error + $cmdp = $p; + $cmdp["param"] = _pfc("Missing parameter"); + $cmdp["param"] .= " (".$this->usage.")"; + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } + $container =& $c->getContainerInstance(); $msg = phpFreeChat::PreFilterMsg($param); $container->write($recipient, "*me*", $this->name, $u->nick." ".$msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |