Permalink
Browse files

strlen works better for strings than sizeof :)

  • Loading branch information...
grzeg1 committed Dec 7, 2017
1 parent 40dd446 commit 2a8f73f98154f8d981d02212283f0d324be71a90
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Ouzo/Core/DownloadHandler.php
@@ -3,6 +3,7 @@
* Copyright (c) Ouzo contributors, http://ouzoframework.org
* This file is made available under the MIT License (view the LICENSE file for more information).
*/
namespace Ouzo;
use Ouzo\Utilities\Arrays;
@@ -19,7 +20,7 @@ public function downloadFile(array $fileData)
header('Content-Disposition: attachment; filename="' . $fileData['label'] . '"');
$data = Arrays::getValue($fileData, 'data');
if ($data) {
header('Content-Length:' . sizeof($data));
header('Content-Length:' . strlen($data));
echo $data;
} else {
header('Content-Length:' . filesize($fileData['path']));

0 comments on commit 2a8f73f

Please sign in to comment.