Comparison

plugins/mod_console.lua @ 3614:8b436cc88c0e

mod_console: Don't allow bang bang as the first command in a session, or when the last command is unknown (fixes #218)
author Matthew Wild <mwild1@gmail.com>
date Fri, 12 Nov 2010 11:51:50 +0000
parent 3557:58ab7e61d220
child 3652:8ae10787272a
child 3840:abcbce5e4240
comparison
equal deleted inserted replaced
3613:f617718d2221 3614:8b436cc88c0e
158 session.disconnect(); 158 session.disconnect();
159 end 159 end
160 commands.quit, commands.exit = commands.bye, commands.bye; 160 commands.quit, commands.exit = commands.bye, commands.bye;
161 161
162 commands["!"] = function (session, data) 162 commands["!"] = function (session, data)
163 if data:match("^!!") then 163 if data:match("^!!") and session.env._ then
164 session.print("!> "..session.env._); 164 session.print("!> "..session.env._);
165 return console_listener.onincoming(session.conn, session.env._); 165 return console_listener.onincoming(session.conn, session.env._);
166 end 166 end
167 local old, new = data:match("^!(.-[^\\])!(.-)!$"); 167 local old, new = data:match("^!(.-[^\\])!(.-)!$");
168 if old and new then 168 if old and new then