Commit 936c2d03 authored by Tobias Reich's avatar Tobias Reich
Browse files

Calculate checksum before adding it to the database

parent 05637e42
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment