Mercurial > prosody-hg
comparison util/datamanager.lua @ 7000:2b57f77985a3
util.datamanager: Make sure only strings are passed as data to append()
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 11 Dec 2015 20:30:39 +0100 |
| parents | 0ad66d12113a |
| children | 2743759ca1b5 |
comparison
equal
deleted
inserted
replaced
| 6999:0ad66d12113a | 7000:2b57f77985a3 |
|---|---|
| 209 return true; | 209 return true; |
| 210 end | 210 end |
| 211 | 211 |
| 212 -- Append a blob of data to a file | 212 -- Append a blob of data to a file |
| 213 local function append(username, host, datastore, ext, data) | 213 local function append(username, host, datastore, ext, data) |
| 214 if type(data) ~= "string" then return; end | |
| 214 local filename = getpath(username, host, datastore, ext, true); | 215 local filename = getpath(username, host, datastore, ext, true); |
| 215 | 216 |
| 216 local ok; | 217 local ok; |
| 217 local f, msg = io_open(filename, "r+"); | 218 local f, msg = io_open(filename, "r+"); |
| 218 if not f then | 219 if not f then |
