Escape error message coming from MySQL to avoid XSS on bad parameters.
This commit is contained in:
@@ -348,6 +348,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'];
|
||||
|
@@ -406,6 +406,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'];
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user