Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 30, 2019
1 parent 471a947 commit 6aefa64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/viewimage.php
Expand Up @@ -170,7 +170,9 @@ function llxFooter()
else $type=dol_mimetype($original_file);

// Security: This wrapper is for images. We do not allow type/html
if (preg_match('/html/', $type)) accessforbidden('Error: Using the image wrapper to output a file with a mime type HTML is not possible.', 1, 1, 1);
if (preg_match('/html/i', $type)) accessforbidden('Error: Using the image wrapper to output a file with a mime type HTML is not possible.', 1, 1, 1);
// Security: This wrapper is for images. We do not allow files ending with .noexe
if (preg_match('/\.noexe$/i', $original_file)) accessforbidden('Error: Using the image wrapper to output a file ending with .noexe is not allowed.', 1, 1, 1);

// Security: Delete string ../ into $original_file
$original_file = str_replace("../","/", $original_file);
Expand Down

0 comments on commit 6aefa64

Please sign in to comment.