This repository was archived by the owner on Jul 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
static/modoboa_webmail/js Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -481,7 +481,7 @@ Webmail.prototype = {
481481 } ) ;
482482 var parts = mailbox . name . split ( this . options . hdelimiter ) ;
483483 var linkcontent = "<span class='fa fa-folder'></span> " ;
484- var displayname = linkcontent + parts [ parts . length - 1 ] ;
484+ var displayname = linkcontent + htmlEncode ( parts [ parts . length - 1 ] ) ;
485485
486486 if ( mailbox . removed ) {
487487 $li . addClass ( 'disabled' ) ;
@@ -769,7 +769,7 @@ Webmail.prototype = {
769769 mailbox = $parent . attr ( "name" ) + this . options . hdelimiter + mailbox ;
770770 } else {
771771 $parent = $ ( "#folders > ul" ) ;
772- }
772+ }
773773 var $li = this . inject_mailbox ( $parent , "loadfolder" , { name : mailbox } ) ;
774774 this . init_droppables ( $li ) ;
775775 } ,
@@ -786,7 +786,7 @@ Webmail.prototype = {
786786 if ( oldname != newname ) {
787787 var $span = $link . children ( "span" ) ;
788788
789- $link . html ( " " + newname ) ;
789+ $link . html ( " " + htmlEncode ( newname ) ) ;
790790 $link . parent ( "li" ) . attr ( "name" , newpattern ) ;
791791 $link . prepend ( $span ) ;
792792 $link . attr ( "href" , newpattern ) ;
Original file line number Diff line number Diff line change 77from django .urls import reverse
88from django .template .loader import render_to_string
99from django .utils .encoding import smart_str
10+ from django .utils .html import escape
1011from django .utils .safestring import mark_safe
1112from django .utils .translation import ugettext as _
1213
@@ -236,7 +237,7 @@ def print_mailboxes(
236237
237238 iclass = mbox ["class" ] if "class" in mbox \
238239 else "fa fa-folder"
239- result += "<span class='%s'></span> %s</a>" % (iclass , label )
240+ result += "<span class='%s'></span> %s</a>" % (iclass , escape ( label ) )
240241
241242 if "sub" in mbox and mbox ["sub" ]:
242243 result += "<ul name='%s' class='nav nav-pills nav-stacked %s'>" % (
You can’t perform that action at this time.
0 commit comments