Commit dda1400b12f9bc63a2c4187efe9d16179f6f9b39

Authored by Theoziran Lima
1 parent 89a46708
Exists in master and in 1 other branch issue488

Remoção de output antes de mostrar imagem

Showing 1 changed file with 6 additions and 5 deletions   Show diff stats
config/file-remote.php
... ... @@ -13,17 +13,18 @@ if(strpos($img, ".jpg") !== false || strpos($img, ".jpeg")){
13 13 }
14 14  
15 15 header("Content-Type: {$contentType}", true);
16   -
  16 +ob_start();
17 17 if(file_exists($img)){
18   - $content = file_get_contents($img);
  18 + readfile($img);
  19 + die;
19 20 }else{
20 21 array_pop($dirs);
21 22 $localDir = implode('/', $dirs);
22   - if(!file_exists($localDir) || is_dir($localDir)){
  23 + if(!file_exists($localDir) || !is_dir($localDir)){
23 24 mkdir($localDir, 777, true);
24 25 }
25 26 $content = file_get_contents("http://pensando.mj.gov.br/{$img}");
26 27 file_put_contents($img, $content);
  28 + ob_clean();
  29 + echo $content;
27 30 }
28   -
29   -die($content);
... ...