Skip to content

Commit dbb97a8

Browse files
committed
escapeHTML when browsing shared files
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent e2bf90b commit dbb97a8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: js/files/circles.files.list.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
*
2424
*/
25+
26+
27+
function escapeHTML(text) {
28+
return text.toString()
29+
.split('&').join('&amp;')
30+
.split('<').join('&lt;')
31+
.split('>').join('&gt;')
32+
.split('"').join('&quot;')
33+
.split('\'').join('&#039;')
34+
}
35+
2536
(function() {
2637
/**
2738
* @class OCA.Circles.FileList
@@ -124,12 +135,11 @@
124135
},
125136

126137
formatResult: function (circle) {
127-
return circle.name;
138+
return escapeHTML(circle.name);
128139
},
129140

130141
formatSelection: function (circle) {
131-
return circle.name;
132-
//return OC.SystemTags.getDescriptiveTag(tag)[0].outerHTML;
142+
return escapeHTML(circle.name);
133143
},
134144

135145
sortResults: function(results) {

0 commit comments

Comments
 (0)