Mercurial > prosody-hg
comparison util/stanza.lua @ 11264:2cdcf55c6dd5
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 08 Jan 2021 23:56:27 +0100 |
| parents | f051394762ff be38ae8fdfa5 |
| children | 21217f7e82b9 |
comparison
equal
deleted
inserted
replaced
| 11260:08b397c21805 | 11264:2cdcf55c6dd5 |
|---|---|
| 64 end | 64 end |
| 65 | 65 |
| 66 local function check_text(text, text_type) | 66 local function check_text(text, text_type) |
| 67 if type(text) ~= "string" then | 67 if type(text) ~= "string" then |
| 68 error("invalid "..text_type.." value: expected string, got "..type(text)); | 68 error("invalid "..text_type.." value: expected string, got "..type(text)); |
| 69 elseif not valid_xml_cdata(text) then | 69 elseif not valid_xml_cdata(text, false) then |
| 70 error("invalid "..text_type.." value: contains control characters"); | 70 error("invalid "..text_type.." value: contains control characters"); |
| 71 elseif not valid_utf8(text, false) then | 71 elseif not valid_utf8(text) then |
| 72 error("invalid "..text_type.." value: contains invalid utf8"); | 72 error("invalid "..text_type.." value: contains invalid utf8"); |
| 73 end | 73 end |
| 74 end | 74 end |
| 75 | 75 |
| 76 local function check_attr(attr) | 76 local function check_attr(attr) |
