Skip to content

Commit

Permalink
escapeHTML when browsing shared files
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jul 1, 2021
1 parent 44b2070 commit 16d41f0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions js/files/circles.files.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/


function escapeHTML(text) {
return text.toString()
.split('&').join('&amp;')
.split('<').join('&lt;')
.split('>').join('&gt;')
.split('"').join('&quot;')
.split('\'').join('&#039;')
}

(function() {
/**
* @class OCA.Circles.FileList
Expand Down Expand Up @@ -124,12 +135,11 @@
},

formatResult: function (circle) {
return circle.name;
return escapeHTML(circle.name);
},

formatSelection: function (circle) {
return circle.name;
//return OC.SystemTags.getDescriptiveTag(tag)[0].outerHTML;
return escapeHTML(circle.name);
},

sortResults: function(results) {
Expand Down

0 comments on commit 16d41f0

Please sign in to comment.