Adds ast_escape_encoded utility to properly handle escaping of quoted field before uri.

This commit backports a feature in trunk affecting initreqprep so that display name won't
be encoded improperly. Also includes unit tests for the ast_escape_quoted function.
This patch gives 1.8 a much improved outlook in countries which don't use standard
ASCII characters.

(closes issue ASTERISK-16949)
Reported by: Örn Arnarson
Review: https://reviewboard.asterisk.org/r/1235/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2011-06-09 14:06:42 +00:00
parent e0b2c103f6
commit 5f46b994f4
4 changed files with 95 additions and 1 deletions

View File

@@ -11537,7 +11537,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
ast_string_field_set(p, fromname, n);
if (sip_cfg.pedanticsipchecking) {
ast_uri_encode(n, tmp_n, sizeof(tmp_n), 0);
ast_escape_quoted(n, tmp_n, sizeof(tmp_n));
n = tmp_n;
ast_uri_encode(l, tmp_l, sizeof(tmp_l), 0);
l = tmp_l;