Coding style

This commit is contained in:
Michal Čihař 2011-08-04 14:12:09 +02:00
parent b9a7ac7425
commit 17689a2df4

View File

@ -1,7 +1,8 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* "Echo" service to allow force downloading of exported charts (png or svg) and server status monitor settings
* "Echo" service to allow force downloading of exported charts (png or svg)
* and server status monitor settings
*
* @package phpMyAdmin
*/
@ -11,17 +12,21 @@ require_once './libraries/common.inc.php';
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');
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();
}