Skip to content

Commit

Permalink
Escape attributes when showing images in javascript
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jun 20, 2016
1 parent 1e5716c commit 7966161
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/get_image.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ function PMA_getImage(image, alternate, attributes) {
}
// set alt
if (attributes.alt != undefined) {
retval.attr('alt', attributes.alt);
retval.attr('alt', escapeHtml(attributes.alt));
} else {
retval.attr('alt', alternate);
retval.attr('alt', escapeHtml(alternate));
}
// set title
if (attributes.title != undefined) {
retval.attr('title', attributes.title);
retval.attr('title', escapeHtml(attributes.title));
} else {
retval.attr('title', alternate);
retval.attr('title', escapeHtml(alternate));
}
// set src
var klass = image.replace('.gif', '').replace('.png', '');
Expand Down

0 comments on commit 7966161

Please sign in to comment.