diff --git a/file_echo.php b/file_echo.php index da8baa0529..0fbd5a6341 100644 --- a/file_echo.php +++ b/file_echo.php @@ -1,7 +1,8 @@ 'png', 'image/svg+xml'=>'svg'); - if (! isset($allowed[$_REQUEST['type']])) exit('Invalid export type'); + if (! isset($allowed[$_REQUEST['type']])) { + exit('Invalid export type'); + } - if (! preg_match("/(".implode("|",$allowed).")$/i", $_REQUEST['filename'])) + if (! preg_match("/(".implode("|",$allowed).")$/i", $_REQUEST['filename'])) { $_REQUEST['filename'] .= '.' . $allowed[$_REQUEST['type']]; + } downloadHeader($_REQUEST['filename'],$_REQUEST['type']); - if ($allowed[$_REQUEST['type']] != 'svg') + if ($allowed[$_REQUEST['type']] != 'svg') { echo base64_decode(substr($_REQUEST['image'], strpos($_REQUEST['image'],',') + 1)); - else + } else { echo $_REQUEST['image']; + } exit(); }