Calculate checksum before adding it to the database
This commit is contained in:
parent
05637e42d8
commit
936c2d0344
@ -113,6 +113,10 @@ class Photo extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Calculate checksum
|
||||||
|
$checksum = sha1_file($path);
|
||||||
|
if ($checksum===false) $checksum = '';
|
||||||
|
|
||||||
# Read infos
|
# Read infos
|
||||||
$info = $this->getInfo($path);
|
$info = $this->getInfo($path);
|
||||||
|
|
||||||
@ -159,7 +163,7 @@ class Photo extends Module {
|
|||||||
'" . $albumID . "',
|
'" . $albumID . "',
|
||||||
'" . $public . "',
|
'" . $public . "',
|
||||||
'" . $star . "',
|
'" . $star . "',
|
||||||
'" . sha1_file($path) . "');";
|
'" . $checksum . "');";
|
||||||
$result = $this->database->query($query);
|
$result = $this->database->query($query);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user