forked from extern/egroupware
WIP of background & logo image upload into instance dir:
- Fix regexp can not cope with spaces
This commit is contained in:
parent
5a2df924eb
commit
695cf12ded
@ -25,7 +25,7 @@ $path = $GLOBALS['egw_info']['server']['files_dir'].'/anon-images';
|
|||||||
|
|
||||||
if (!file_exists($path) || empty($_GET['src']) ||
|
if (!file_exists($path) || empty($_GET['src']) ||
|
||||||
basename($_GET['src']) !== $_GET['src'] || // make sure no directory traversal
|
basename($_GET['src']) !== $_GET['src'] || // make sure no directory traversal
|
||||||
!preg_match('/^[a-z0-9._-]+\.(jpe?g|png|gif|svg)$/i', $_GET['src']) || // only allow images, not eg. Javascript!
|
!preg_match('/^[a-z 0-9._-]+\.(jpe?g|png|gif|svg)$/i', $_GET['src']) || // only allow images, not eg. Javascript!
|
||||||
!file_exists($path .= '/'.$_GET['src']) ||
|
!file_exists($path .= '/'.$_GET['src']) ||
|
||||||
!($fp = fopen($path, 'r')))
|
!($fp = fopen($path, 'r')))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user