aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-12-12 07:07:13 +0100
committerKim Alvefur <zash@zash.se>2022-12-12 07:07:13 +0100
commit63fde85044d6323d9316e3f4ed33718ba5f035de (patch)
treeca5f958ac3a03c36b22ced0751300ee1efae531b
parentd158455de6ea757b2f391e3a7470a5c8429a6c92 (diff)
parentcaf2e273620c5b8dbfe56203725e23684849648a (diff)
downloadprosody-0.12.2.tar.gz
prosody-0.12.2.zip
Merge 0.11->0.120.12.2
-rw-r--r--util/stanza.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 29551918..86b88169 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -34,8 +34,12 @@ local _ENV = nil;
local stanza_mt = { __name = "stanza" };
stanza_mt.__index = stanza_mt;
+-- Basic check for valid XML character data.
+-- Disallow control characters.
+-- Tab U+09 and newline U+0A are allowed.
+-- For attributes, allow the \1 separator between namespace and name.
local function valid_xml_cdata(str, attr)
- return not s_find(str, attr and "[^\1\9\10\13\20-~\128-\247]" or "[^\9\10\13\20-~\128-\247]");
+ return not s_find(str, attr and "[^\1\9\10\13\20-\255]" or "[^\9\10\13\20-\255]");
end
local function check_name(name, name_type)