mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Bug #27884: mysql --html does not quote HTML special characters in output
Fix encoding of field values and names in HTML output from mysql client.
This commit is contained in:
@@ -3381,9 +3381,12 @@ print_table_data_html(MYSQL_RES *result)
|
||||
{
|
||||
while((field = mysql_fetch_field(result)))
|
||||
{
|
||||
tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
|
||||
(field->name[0] ? field->name :
|
||||
" ") : "NULL"));
|
||||
tee_fputs("<TH>", PAGER);
|
||||
if (field->name && field->name[0])
|
||||
xmlencode_print(field->name, field->name_length);
|
||||
else
|
||||
tee_fputs(field->name ? " " : "NULL", PAGER);
|
||||
tee_fputs("</TH>", PAGER);
|
||||
}
|
||||
(void) tee_fputs("</TR>", PAGER);
|
||||
}
|
||||
@@ -3396,7 +3399,7 @@ print_table_data_html(MYSQL_RES *result)
|
||||
for (uint i=0; i < mysql_num_fields(result); i++)
|
||||
{
|
||||
(void) tee_fputs("<TD>", PAGER);
|
||||
safe_put_field(cur[i],lengths[i]);
|
||||
xmlencode_print(cur[i], lengths[i]);
|
||||
(void) tee_fputs("</TD>", PAGER);
|
||||
}
|
||||
(void) tee_fputs("</TR>", PAGER);
|
||||
|
Reference in New Issue
Block a user