Calculate checksum before adding it to the database

This commit is contained in:
Tobias Reich 2014-07-20 16:45:30 +02:00
parent 05637e42d8
commit 936c2d0344

View File

@ -113,6 +113,10 @@ class Photo extends Module {
}
}
# Calculate checksum
$checksum = sha1_file($path);
if ($checksum===false) $checksum = '';
# Read infos
$info = $this->getInfo($path);
@ -159,7 +163,7 @@ class Photo extends Module {
'" . $albumID . "',
'" . $public . "',
'" . $star . "',
'" . sha1_file($path) . "');";
'" . $checksum . "');";
$result = $this->database->query($query);
if (!$result) {