25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

* src/expat_erl.c: Use binaries for CDATA

* src/xml.erl: Likewise

SVN Revision: 526
This commit is contained in:
Alexey Shchepin 2006-04-05 23:56:16 +00:00
parent ed43f8024c
commit a5a978946d
3 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2006-04-06 Alexey Shchepin <alexey@sevcom.net>
* src/expat_erl.c: Use binaries for CDATA
* src/xml.erl: Likewise
2006-04-02 Alexey Shchepin <alexey@sevcom.net> 2006-04-02 Alexey Shchepin <alexey@sevcom.net>
* src/msgs/ru.msg: Updated (thanks to Sergei Golovan) * src/msgs/ru.msg: Updated (thanks to Sergei Golovan)

View File

@ -164,7 +164,7 @@ void *erlXML_CharacterDataHandler(expat_data *d,
ei_x_encode_list_header(&event_buf, 1); ei_x_encode_list_header(&event_buf, 1);
ei_x_encode_tuple_header(&event_buf, 2); ei_x_encode_tuple_header(&event_buf, 2);
ei_x_encode_long(&event_buf, XML_CDATA); ei_x_encode_long(&event_buf, XML_CDATA);
ei_x_encode_string_len_fixed(&event_buf, s, len); ei_x_encode_binary(&event_buf, s, len);
return NULL; return NULL;
} }

View File

@ -105,7 +105,7 @@ attr_to_list({Name, Value}) ->
%crypt([], R) -> %crypt([], R) ->
% R. % R.
crypt(S) -> crypt(S) when is_list(S) ->
[case C of [case C of
$& -> "&amp;"; $& -> "&amp;";
$< -> "&lt;"; $< -> "&lt;";
@ -113,7 +113,9 @@ crypt(S) ->
$" -> "&quot;"; $" -> "&quot;";
$' -> "&apos;"; $' -> "&apos;";
_ -> C _ -> C
end || C <- S]. end || C <- S];
crypt(S) when is_binary(S) ->
crypt(binary_to_list(S)).
%crypt1(S) -> %crypt1(S) ->
% lists:flatten([case C of % lists:flatten([case C of
@ -159,10 +161,10 @@ remove_cdata(L) -> [E || E <- L, remove_cdata_p(E)].
% R. % R.
get_cdata(L) -> get_cdata(L) ->
get_cdata(L, ""). binary_to_list(list_to_binary(get_cdata(L, ""))).
get_cdata([{xmlcdata, CData} | L], S) -> get_cdata([{xmlcdata, CData} | L], S) ->
get_cdata(L, S ++ CData); get_cdata(L, [S, CData]);
get_cdata([_ | L], S) -> get_cdata([_ | L], S) ->
get_cdata(L, S); get_cdata(L, S);
get_cdata([], S) -> get_cdata([], S) ->