mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 06:37:56 -04:00
fix for Allowed memory size of xx bytes exhausted while reading big files
This commit is contained in:
parent
84c56a5d56
commit
0a7aa6e8cd
1 changed files with 12 additions and 5 deletions
|
|
@ -480,13 +480,20 @@ class Util {
|
|||
*/
|
||||
public function isEncryptedPath( $path ) {
|
||||
|
||||
// Disable encryption proxy so data retreived is in its
|
||||
// Disable encryption proxy so data retrieved is in its
|
||||
// original form
|
||||
$proxyStatus = \OC_FileProxy::$enabled;
|
||||
\OC_FileProxy::$enabled = false;
|
||||
|
||||
$data = $this->view->file_get_contents( $path );
|
||||
|
||||
\OC_FileProxy::$enabled = true;
|
||||
|
||||
// we only need 24 byte from the last chunk
|
||||
$data = '';
|
||||
$handle = $this->view->fopen( $path, 'r' );
|
||||
if(!fseek($handle, -24, SEEK_END)) {
|
||||
$data = fgets($handle);
|
||||
}
|
||||
|
||||
// re-enable proxy
|
||||
\OC_FileProxy::$enabled = $proxyStatus;
|
||||
|
||||
return Crypt::isCatfileContent( $data );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue