diff options
author | Michal Čihař <mcihar@suse.cz> | 2011-08-04 16:47:11 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2011-08-04 16:47:11 +0400 |
commit | 440f72082fb21b418818b7331863af56094f7bcc (patch) | |
tree | a5af10075b28ed9baed43782637af2f56602eb49 /file_echo.php | |
parent | 73fb08d3d81f33edba2550ceaa1a8bfd3418f172 (diff) |
Coding style, simplify flow, remove exit() calls
Diffstat (limited to 'file_echo.php')
-rw-r--r-- | file_echo.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/file_echo.php b/file_echo.php index d2f72574fc..7b27ffa3ce 100644 --- a/file_echo.php +++ b/file_echo.php @@ -9,11 +9,14 @@ require_once './libraries/common.inc.php'; -if(isset($_REQUEST['filename']) && isset($_REQUEST['image'])) { - $allowed = Array( 'image/png'=>'png', 'image/svg+xml'=>'svg'); +if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) { + $allowed = array( + 'image/png' => 'png', + 'image/svg+xml' => 'svg', + ); if (! isset($allowed[$_REQUEST['type']])) { - exit('Invalid export type'); + die('Invalid export type'); } if (! preg_match("/(".implode("|",$allowed).")$/i", $_REQUEST['filename'])) { @@ -28,17 +31,10 @@ if(isset($_REQUEST['filename']) && isset($_REQUEST['image'])) { echo $_REQUEST['image']; } - exit(); -} - -if(isset($_REQUEST['monitorconfig'])) { +} else if (isset($_REQUEST['monitorconfig'])) { PMA_download_header('monitor.cfg', 'application/force-download'); echo urldecode($_REQUEST['monitorconfig']); - exit(); -} - -if(isset($_REQUEST['import'])) { +} else if (isset($_REQUEST['import'])) { echo '<html><body>' . file_get_contents($_FILES['file']['tmp_name']) . '</body></html>'; - exit(); } ?> |