Skip to content
Snippets Groups Projects
Commit 56b8d13b authored by Samantha Ming's avatar Samantha Ming
Browse files

Sanitize search text to prevent XSS

parent 635e1578
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,6 +5,7 @@ import fuzzaldrinPlus from 'fuzzaldrin-plus';
import axios from '~/lib/utils/axios_utils';
import flash from '~/flash';
import { __ } from '~/locale';
import sanitize from 'sanitize-html';
 
// highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> )
const highlighter = function(element, text, matches) {
Loading
Loading
@@ -75,7 +76,7 @@ export default class ProjectFindFile {
 
findFile() {
var result, searchText;
searchText = this.inputElement.val();
searchText = sanitize(this.inputElement.val());
result =
searchText.length > 0 ? fuzzaldrinPlus.filter(this.filePaths, searchText) : this.filePaths;
return this.renderList(result, searchText);
Loading
Loading
---
title: Sanitize search text to prevent XSS
merge_request:
author:
type: security
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment