mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	res_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity is unquoted.
The local entity as provided by PJSIP is quoted within '<' and '>'. As a result placing this value into XML will result in malformed XML being produced. This patch now unquotes the local entity so it can go safely into the XML. Review: https://reviewboard.asterisk.org/r/3851/ ........ Merged revisions 419750 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -38,10 +38,11 @@ | ||||
| static void *pidf_allocate_body(void *data) | ||||
| { | ||||
| 	struct ast_sip_exten_state_data *state_data = data; | ||||
| 	char *local = ast_strdupa(state_data->local); | ||||
| 	pjpidf_pres *pres; | ||||
| 	pj_str_t entity; | ||||
|  | ||||
| 	pres = pjpidf_create(state_data->pool, pj_cstr(&entity, state_data->local)); | ||||
| 	pres = pjpidf_create(state_data->pool, pj_cstr(&entity, ast_strip_quoted(local, "<", ">"))); | ||||
|  | ||||
| 	return pres; | ||||
| } | ||||
|   | ||||
| @@ -39,10 +39,11 @@ | ||||
| static void *xpidf_allocate_body(void *data) | ||||
| { | ||||
| 	struct ast_sip_exten_state_data *state_data = data; | ||||
| 	char *local = ast_strdupa(state_data->local); | ||||
| 	pjxpidf_pres *pres; | ||||
| 	pj_str_t name; | ||||
|  | ||||
| 	pres = pjxpidf_create(state_data->pool, pj_cstr(&name, state_data->local)); | ||||
| 	pres = pjxpidf_create(state_data->pool, pj_cstr(&name, ast_strip_quoted(local, "<", ">"))); | ||||
| 	return pres; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user