FS-3971 --resolve

This commit is contained in:
Anthony Minessale
2012-09-04 12:29:58 -05:00
parent ff3631b474
commit 455b22480c
2 changed files with 37 additions and 1 deletions

View File

@@ -463,6 +463,42 @@ SWITCH_DECLARE(char *) switch_amp_encode(char *s, char *buf, switch_size_t len)
for (p = s; x < len; p++) {
switch (*p) {
case '"':
if (x + 6 > len - 1) {
goto end;
}
*q++ = '&';
*q++ = 'q';
*q++ = 'u';
*q++ = 'o';
*q++ = 't';
*q++ = ';';
x += 6;
break;
case '\'':
if (x + 6 > len - 1) {
goto end;
}
*q++ = '&';
*q++ = 'a';
*q++ = 'p';
*q++ = 'o';
*q++ = 's';
*q++ = ';';
x += 6;
break;
case '&':
if (x + 5 > len - 1) {
goto end;
}
*q++ = '&';
*q++ = 'a';
*q++ = 'm';
*q++ = 'p';
*q++ = ';';
x += 5;
break;
case '<':
if (x + 4 > len - 1) {
goto end;