Manage new-lines and extra whitespaces properly

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2016-10-07 10:24:26 +05:30
parent be5196ba44
commit 54875fffc1

View File

@ -131,14 +131,16 @@ if (isset($_REQUEST['report_export'])
) {
@ini_set('url_rewriter.tags', '');
// Replace all multiple whitespaces by a single space
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_REQUEST['table']));
$dump = "# " . sprintf(
__('Tracking report for table `%s`'), htmlspecialchars($_REQUEST['table'])
__('Tracking report for table `%s`'), $table
)
. "\n" . "# " . date('Y-m-d H:i:s') . "\n";
foreach ($entries as $entry) {
$dump .= $entry['statement'];
}
$filename = 'log_' . htmlspecialchars($_REQUEST['table']) . '.sql';
$filename = 'log_' . $table . '.sql';
PMA_downloadHeader($filename, 'text/x-sql', strlen($dump));
echo $dump;