From 54875fffc12da0f1c0c2b6042e638b08fc337e2a Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Fri, 7 Oct 2016 10:24:26 +0530 Subject: [PATCH] Manage new-lines and extra whitespaces properly Signed-off-by: Deven Bansod --- tbl_tracking.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tbl_tracking.php b/tbl_tracking.php index 33208ce51a..456636a104 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -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;