Fix: clear file name send by php
This commit is contained in:
parent
6c963fc591
commit
e9994c683a
@ -495,7 +495,10 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
|||||||
*/
|
*/
|
||||||
function dol_unescapefile($filename)
|
function dol_unescapefile($filename)
|
||||||
{
|
{
|
||||||
return stripslashes($filename);
|
// Remove path information and dots around the filename, to prevent uploading
|
||||||
|
// into different directories or replacing hidden system files.
|
||||||
|
// Also remove control characters and spaces (\x00..\x20) around the filename:
|
||||||
|
return trim(basename(stripslashes($filename)), ".\x00..\x20");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user