equal
deleted
inserted
replaced
68 error("invalid attributes: expected table, got "..type(attr)); |
68 error("invalid attributes: expected table, got "..type(attr)); |
69 end |
69 end |
70 for k, v in pairs(attr) do |
70 for k, v in pairs(attr) do |
71 check_name(k, "attribute"); |
71 check_name(k, "attribute"); |
72 check_text(v, "attribute"); |
72 check_text(v, "attribute"); |
73 if type(v) ~= "string" then |
|
74 error("invalid attribute value for '"..k.."': expected string, got "..type(v)); |
|
75 elseif not valid_utf8(v) then |
|
76 error("invalid attribute value for '"..k.."': contains invalid utf8"); |
|
77 end |
|
78 end |
73 end |
79 end |
74 end |
80 end |
75 end |
81 |
76 |
82 local function new_stanza(name, attr, namespaces) |
77 local function new_stanza(name, attr, namespaces) |