Escape error message coming from MySQL to avoid XSS on bad parameters.
This commit is contained in:
@@ -300,6 +300,8 @@ function PMA_DBI_getError($link = null)
|
||||
$error_message = PMA_DBI_convert_message($error_message);
|
||||
}
|
||||
|
||||
$error_message = htmlspecialchars($error_message);
|
||||
|
||||
// Some errors messages cannot be obtained by mysql_error()
|
||||
if ($error_number == 2002) {
|
||||
$error = '#' . ((string) $error_number) . ' - ' . $GLOBALS['strServerNotResponding'] . ' ' . $GLOBALS['strSocketProblem'];
|
||||
|
@@ -417,6 +417,8 @@ function PMA_DBI_getError($link = null)
|
||||
$error_message = PMA_DBI_convert_message($error_message);
|
||||
}
|
||||
|
||||
$error_message = htmlspecialchars($error_message);
|
||||
|
||||
if ($error_number == 2002) {
|
||||
$error = '#' . ((string) $error_number) . ' - ' . $GLOBALS['strServerNotResponding'] . ' ' . $GLOBALS['strSocketProblem'];
|
||||
} elseif (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
|
Reference in New Issue
Block a user