Commit 934855da authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

use fs class member

parent 93d5f3cb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -49,9 +49,8 @@ class BookImageDataHandler extends CatalogBookHandler

        $pathInfo = pathinfo($publicationFile->getData('path'));
        $imagePath = $pathInfo['dirname'] . DIRECTORY_SEPARATOR . $pathInfo['filename'] . DIRECTORY_SEPARATOR . $imgName;
        $fs = Services::get('file')->fs;
        $mimetype = $file->mimetype ?? 'application/octet-stream';
        $filesize = $fs->fileSize($imagePath);
        $filesize = $this->fs->fileSize($imagePath);
        $encodedFilename = urlencode($imgName);
        header("Content-Type: {$mimetype}");
        header("Content-Length: {$filesize}");
@@ -59,7 +58,7 @@ class BookImageDataHandler extends CatalogBookHandler
        header('Content-Disposition: inline' . ";filename=\"{$encodedFilename}\";filename*=UTF-8''{$encodedFilename}");
        header('Cache-Control: private'); // Workarounds for IE weirdness
        header('Pragma: public');
        fpassthru($fs->readStream($imagePath));
        fpassthru($this->fs->readStream($imagePath));
        exit;