Server IP : 127.0.0.2 / Your IP : 18.117.82.179 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpmyadmin/ |
Upload File : |
<?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 * * @package PhpMyAdmin */ define('PMA_MINIMUM_COMMON', true); require_once 'libraries/common.inc.php'; /* For chart exporting */ if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) { $allowed = array( 'image/png' => 'png', 'image/svg+xml' => 'svg', ); /* Check whether MIME type is allowed */ if (! isset($allowed[$_REQUEST['type']])) { PMA_fatalError(__('Invalid export type')); } /* * Check file name to match mime type and not contain new lines * to prevent response splitting. */ $extension = $allowed[$_REQUEST['type']]; $valid_match = '/^[^\n\r]*\.' . $extension . '$/'; if (! preg_match($valid_match, $_REQUEST['filename'])) { if (! preg_match('/^[^\n\r]*$/', $_REQUEST['filename'])) { /* Filename is unsafe, discard it */ $filename = 'download.' . $extension; } else { /* Add extension */ $filename = $_REQUEST['filename'] . '.' . $extension; } } else { /* Filename from request should be safe here */ $filename = $_REQUEST['filename']; } /** @var PMA_String $pmaString */ $pmaString = $GLOBALS['PMA_String']; /* Decode data */ if ($extension != 'svg') { $data = /*overload*/mb_substr( $_REQUEST['image'], /*overload*/mb_strpos($_REQUEST['image'], ',') + 1 ); $data = base64_decode($data); } else { $data = $_REQUEST['image']; } /* Send download header */ PMA_downloadHeader( $filename, $_REQUEST['type'], /*overload*/mb_strlen($data) ); /* Send data */ echo $data; } else if (isset($_REQUEST['monitorconfig'])) { /* For monitor chart config export */ PMA_downloadHeader('monitor.cfg', 'application/force-download'); echo urldecode($_REQUEST['monitorconfig']); } else if (isset($_REQUEST['import'])) { /* For monitor chart config import */ header('Content-type: text/plain'); if (!file_exists($_FILES['file']['tmp_name'])) { exit(); } echo file_get_contents($_FILES['file']['tmp_name']); }