aboutsummaryrefslogtreecommitdiffstats
path: root/util/storageconv
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
committerMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
commitfe7ecede700fe04631d23f36473e697ce2b364dc (patch)
treee713fc39dba500a25cb2acf8561e286fb8b41ff0 /util/storageconv
parent42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff)
parent089708ab9f90309a0c27ae633cf8f2604fce1170 (diff)
downloadvolse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip
Merge branch '6.4RC'6.4
Diffstat (limited to 'util/storageconv')
-rwxr-xr-xutil/storageconv19
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'];