Skip to content

Commit 7966161

Browse files
committed
Escape attributes when showing images in javascript
Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 1e5716c commit 7966161

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/get_image.js.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ function PMA_getImage(image, alternate, attributes) {
109109
}
110110
// set alt
111111
if (attributes.alt != undefined) {
112-
retval.attr('alt', attributes.alt);
112+
retval.attr('alt', escapeHtml(attributes.alt));
113113
} else {
114-
retval.attr('alt', alternate);
114+
retval.attr('alt', escapeHtml(alternate));
115115
}
116116
// set title
117117
if (attributes.title != undefined) {
118-
retval.attr('title', attributes.title);
118+
retval.attr('title', escapeHtml(attributes.title));
119119
} else {
120-
retval.attr('title', alternate);
120+
retval.attr('title', escapeHtml(alternate));
121121
}
122122
// set src
123123
var klass = image.replace('.gif', '').replace('.png', '');

0 commit comments

Comments
 (0)