prevent xss attacks also if some javascript ends up in the alt-tag

remotes/origin/stable45
Bjoern Schiessle 13 years ago
parent 87855f2506
commit d28a4f0638
  1. 3
      apps/files_imageviewer/js/jquery.fancybox-1.3.4.js
  2. 2
      apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js

@ -84,7 +84,6 @@
}
title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
title = title.replace(/</, "&lt;").replace(/>/, "&gt;");
if (obj.nodeName && !selectedOpts.orig) {
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
@ -94,6 +93,8 @@
title = selectedOpts.orig.attr('alt');
}
title = title.replace(/</, "&lt;").replace(/>/, "&gt;");
href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
if ((/^(?:javascript)/i).test(href) || href == '#') {

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save