mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
fixes #600, avoid html in web uploaded filenames
This commit is contained in:
parent
746c796d9d
commit
6ec3f2d0fa
2 changed files with 6 additions and 1 deletions
|
@ -216,7 +216,7 @@ $http_headers[] = 'Content-Type: '.$ctype;
|
||||||
|
|
||||||
if (isset($_GET['download']))
|
if (isset($_GET['download']))
|
||||||
{
|
{
|
||||||
$http_headers[] = 'Content-Disposition: attachment; filename="'.$element_info['file'].'";';
|
$http_headers[] = 'Content-Disposition: attachment; filename="'.htmlspecialchars_decode($element_info['file']).'";';
|
||||||
$http_headers[] = 'Content-Transfer-Encoding: binary';
|
$http_headers[] = 'Content-Transfer-Encoding: binary';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -161,6 +161,11 @@ function add_uploaded_file($source_filepath, $original_filename=null, $categorie
|
||||||
|
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
|
if (!is_null($original_filename))
|
||||||
|
{
|
||||||
|
$original_filename = htmlspecialchars($original_filename);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($original_md5sum))
|
if (isset($original_md5sum))
|
||||||
{
|
{
|
||||||
$md5sum = $original_md5sum;
|
$md5sum = $original_md5sum;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue