Software /
code /
prosody
Comparison
util/dataforms.lua @ 4887:4dd61fe04db4
util.dataforms: Don't return invalid JIDs in jid-single.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 17 May 2012 21:25:41 +0200 |
parent | 4886:26d8e4665ce9 |
child | 4928:5211c11dd865 |
comparison
equal
deleted
inserted
replaced
4886:26d8e4665ce9 | 4887:4dd61fe04db4 |
---|---|
154 local raw_data = field_tag:get_child_text("value") | 154 local raw_data = field_tag:get_child_text("value") |
155 local data = jid_prep(raw_data); | 155 local data = jid_prep(raw_data); |
156 if data and #data > 0 then | 156 if data and #data > 0 then |
157 return data | 157 return data |
158 elseif raw_data then | 158 elseif raw_data then |
159 return raw_data, "Invalid JID"; | 159 return nil, "Invalid JID: " .. raw_data; |
160 elseif required then | 160 elseif required then |
161 return nil, "Required value missing"; | 161 return nil, "Required value missing"; |
162 end | 162 end |
163 end | 163 end |
164 | 164 |