summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-04-16 10:47:18 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-04-16 10:47:18 +0200
commit7426569d8680711e9ff22d5c86c631504f23559b (patch)
treead44276801c10ebb02d4efd281ad90346676fcea /src/core
parent619f470f9fc152b599ee6c92207c358f555e4c51 (diff)
downloadweechat-7426569d8680711e9ff22d5c86c631504f23559b.zip
core: prohibit names beginning with "#" for bars, proxies, filters and IRC servers (bug #33020)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index e11dd9a49..fb3af2d2a 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -203,6 +203,13 @@ COMMAND_CALLBACK(bar)
if (string_strcasecmp (argv[1], "add") == 0)
{
COMMAND_MIN_ARGS(8, "bar add");
+ if (argv[2][0] == '#')
+ {
+ gui_chat_printf (NULL,
+ _("%sError: name can not start with \"#\""),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ return WEECHAT_RC_ERROR;
+ }
pos_condition = strchr (argv[3], ',');
if (pos_condition)
{
@@ -1380,6 +1387,13 @@ COMMAND_CALLBACK(filter)
argv[2]);
return WEECHAT_RC_ERROR;
}
+ if (argv[2][0] == '#')
+ {
+ gui_chat_printf (NULL,
+ _("%sError: name can not start with \"#\""),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ return WEECHAT_RC_ERROR;
+ }
if ((strcmp (argv[4], "*") == 0) && (strcmp (argv_eol[5], "*") == 0))
{
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
@@ -3210,6 +3224,13 @@ COMMAND_CALLBACK(proxy)
if (string_strcasecmp (argv[1], "add") == 0)
{
COMMAND_MIN_ARGS(6, "proxy add");
+ if (argv[2][0] == '#')
+ {
+ gui_chat_printf (NULL,
+ _("%sError: name can not start with \"#\""),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ return WEECHAT_RC_ERROR;
+ }
type = proxy_search_type (argv[3]);
if (type < 0)
{