diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-27 13:14:35 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-27 13:14:35 +0000 |
commit | 4e84bd03f2b067660bb3feb9070a4d7b0b0e55de (patch) | |
tree | 49df3225e8f9829d3f5fde0630e3ef4123da726a /pbx | |
parent | 06970c41df1de99e08847e44f1ac62ee08079ed4 (diff) |
Merged revisions 118300 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r118300 | tilghman | 2008-05-27 08:13:17 -0500 (Tue, 27 May 2008) | 4 lines
In compat14 mode, don't translate pipes inside expressions, as they aren't
argument delimiters, but rather 'or' symbols.
(Closes issue #12723)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@118301 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_realtime.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pbx/pbx_realtime.c b/pbx/pbx_realtime.c index ea2ee9bab..6e5a9f7e1 100644 --- a/pbx/pbx_realtime.c +++ b/pbx/pbx_realtime.c @@ -181,17 +181,26 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch else if (!strcasecmp(v->name, "appdata")) { if (!compat16) { char *ptr; + int in = 0; tmp = alloca(strlen(v->value) * 2 + 1); for (ptr = tmp; *v->value; v->value++) { if (*v->value == ',') { *ptr++ = '\\'; *ptr++ = ','; - } else if (*v->value == '|') { + } else if (*v->value == '|' && !in) { *ptr++ = ','; } else { *ptr++ = *v->value; } + + /* Don't escape '|', meaning 'or', inside expressions ($[ ]) */ + if (v->value[0] == '[' && v->value[-1] == '$') { + in++; + } else if (v->value[0] == ']' && in) { + in--; + } } + *ptr = '\0'; } else { tmp = ast_strdupa(v->value); } |