Fix XSS on error with very long query.

This commit is contained in:
Herman van Rink
2010-08-20 10:42:03 +02:00
committed by Michal Čihař
parent d2e0e09e0d
commit f273e6cbf6

View File

@@ -575,7 +575,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
$formatted_sql = ''; $formatted_sql = '';
} else { } else {
if (strlen($the_query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { if (strlen($the_query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$formatted_sql = substr($the_query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]'; $formatted_sql = htmlspecialchars(substr($the_query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'])) . '[...]';
} else { } else {
$formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query); $formatted_sql = PMA_formatSql(PMA_SQP_parse($the_query), $the_query);
} }