diff options
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 62c9d8d2f..9fb0c8bb0 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -9111,11 +9111,18 @@ int pbx_builtin_setvar(struct ast_channel *chan, void *data) mydata = ast_strdupa(data); name = strsep(&mydata, "="); value = mydata; - if (strchr(name, ' ')) + if (!value) { + ast_log(LOG_WARNING, "Set requires an '=' to be a valid assignment.\n"); + return 0; + } + + if (strchr(name, ' ')) { ast_log(LOG_WARNING, "Please avoid unnecessary spaces on variables as it may lead to unexpected results ('%s' set to '%s').\n", name, mydata); + } pbx_builtin_setvar_helper(chan, name, value); - return(0); + + return 0; } int pbx_builtin_setvar_multiple(struct ast_channel *chan, void *vdata) |