mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-06 16:02:23 +00:00
run expand_vars if input contains a special escaped character not just when it contains a variable to eat up back slashes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13015 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
59b3cdc2a6
commit
21538b2bf9
@ -87,7 +87,20 @@ static inline switch_bool_t switch_is_moh(const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline int switch_string_has_escaped_data(const char *in)
|
||||||
|
{
|
||||||
|
const char *i = strchr(in, '\\');
|
||||||
|
|
||||||
|
while (i && *i == '\\') {
|
||||||
|
i++;
|
||||||
|
if (*i == '\\' || *i == 'n' || *i == 's' || *i == 't') {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i = strchr(i, '\\');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size_t ilen, unsigned char *out, switch_size_t olen);
|
SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size_t ilen, unsigned char *out, switch_size_t olen);
|
||||||
SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen);
|
SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen);
|
||||||
|
@ -1916,7 +1916,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
|
|||||||
return (char *) in;
|
return (char *) in;
|
||||||
}
|
}
|
||||||
|
|
||||||
nv = switch_string_var_check_const(in);
|
nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in);
|
||||||
|
|
||||||
if (!nv) {
|
if (!nv) {
|
||||||
return (char *) in;
|
return (char *) in;
|
||||||
|
@ -1331,7 +1331,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
|||||||
char *func_val = NULL;
|
char *func_val = NULL;
|
||||||
int nv = 0;
|
int nv = 0;
|
||||||
|
|
||||||
nv = switch_string_var_check_const(in);
|
nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in);
|
||||||
|
|
||||||
if (!nv) {
|
if (!nv) {
|
||||||
return (char *) in;
|
return (char *) in;
|
||||||
|
@ -1559,6 +1559,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
|
|||||||
if (switch_strlen_zero(digits_regex)) {
|
if (switch_strlen_zero(digits_regex)) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Test Regex [%s][%s]\n", digit_buffer, digits_regex);
|
||||||
if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) {
|
if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,7 +61,6 @@ int switch_inet_pton(int af, const char *src, void *dst)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switch_size_t size)
|
SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switch_size_t size)
|
||||||
{
|
{
|
||||||
switch_frame_t *new_frame;
|
switch_frame_t *new_frame;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user