diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-10-01 17:09:54 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-10-01 17:09:54 +0200 |
commit | 069a5429c927f072287e4924be18797fa8b2f2a9 (patch) | |
tree | 2e284644950e4256addaa20c38060eaafc0387ed /util | |
parent | b1eaa810ce37e4af88fdb41f0067b56f8725ef31 (diff) | |
parent | e5e3c268a2ef7bc0450b1ff20c7e0562163f0c92 (diff) | |
download | volse-hubzilla-069a5429c927f072287e4924be18797fa8b2f2a9.tar.gz volse-hubzilla-069a5429c927f072287e4924be18797fa8b2f2a9.tar.bz2 volse-hubzilla-069a5429c927f072287e4924be18797fa8b2f2a9.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'util')
-rwxr-xr-x | util/storageconv | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/util/storageconv b/util/storageconv index 52bb77fbb..676425038 100755 --- a/util/storageconv +++ b/util/storageconv @@ -77,17 +77,18 @@ if($argc == 2) { } if(! file_put_contents($filename, dbunescbin($xx['content']))) { + @unlink($filename); echo PHP_EOL . 'Failed to save file ' . $filename . PHP_EOL; - continue; } - - $z = q("UPDATE photo SET content = '%s', os_storage = 1 WHERE id = %d", - dbescbin($filename), - intval($xx['id']) - ); - if(! $z) { - @unlink($filename); - echo PHP_EOL . 'Failed to update metadata for saved file ' . $filename . PHP_EOL; + else { + $z = q("UPDATE photo SET content = '%s', os_storage = 1 WHERE id = %d", + dbescbin($filename), + intval($xx['id']) + ); + if(! $z) { + @unlink($filename); + echo PHP_EOL . 'Failed to update metadata for saved file ' . $filename . PHP_EOL; + } } $cur_id = $xx['id']; |