Skip to content

Commit 9d0b191

Browse files
committed
Manage new-lines and extra whitespaces properly
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
1 parent 6d71137 commit 9d0b191

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/tracking.lib.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,14 +1162,16 @@ function PMA_exportAsFileDownload($entries)
11621162
{
11631163
@ini_set('url_rewriter.tags', '');
11641164

1165+
// Replace all multiple whitespaces by a single space
1166+
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_REQUEST['table']));
11651167
$dump = "# " . sprintf(
1166-
__('Tracking report for table `%s`'), htmlspecialchars($_REQUEST['table'])
1168+
__('Tracking report for table `%s`'), $table
11671169
)
11681170
. "\n" . "# " . date('Y-m-d H:i:s') . "\n";
11691171
foreach ($entries as $entry) {
11701172
$dump .= $entry['statement'];
11711173
}
1172-
$filename = 'log_' . htmlspecialchars($_REQUEST['table']) . '.sql';
1174+
$filename = 'log_' . $table . '.sql';
11731175
PMA_Response::getInstance()->disable();
11741176
PMA_downloadHeader(
11751177
$filename,

0 commit comments

Comments
 (0)