Skip to content

Commit 30421e5

Browse files
committed
Now using hash_file when appropriate, instead of
always getting and passing the raw binary buffer data
1 parent d83a12e commit 30421e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/OneMightyRoar/PhpFileManager/FileObject.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,10 @@ public function getHash($algo = self::DEFAULT_HASH_ALGO)
685685
throw new InvalidArgumentException('Hash algorithm not supported by your system');
686686
}
687687

688-
return hash($algo, $this->getRaw());
688+
return (($this->isWrapped() || $this->isTemp()) ?
689+
hash($algo, $this->getRaw())
690+
: hash_file($algo, $this->getPathname())
691+
);
689692
}
690693

691694
/**

0 commit comments

Comments
 (0)