mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Fix saving hash of a deleted file from disk (#4813)
This commit is contained in:
parent
2cfe20a920
commit
a615a26268
@ -36,3 +36,4 @@
|
||||
- Enh #4787: Always enable Space Membership Web Notifications
|
||||
- Enh #4795: Added support for collapsible form fields
|
||||
- Enh #4796: Added option to disable PWA/ServiceWorker support
|
||||
- Fix #4752: Fix saving hash of a deleted file from disk
|
||||
|
@ -157,7 +157,12 @@ class File extends FileCompat
|
||||
*/
|
||||
public function saveHash()
|
||||
{
|
||||
$this->hash_sha1 = sha1_file($this->getStore()->get());
|
||||
$filePath = $this->getStore()->get();
|
||||
if (!is_file($filePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->hash_sha1 = sha1_file($filePath);
|
||||
if (!$this->isNewRecord) {
|
||||
$this->updateAttributes(['hash_sha1' => $this->hash_sha1]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user