Skip to content

Commit

Permalink
🐛 Fix: unencoded Content in Search Leads to JavaScript Execution Risk…
Browse files Browse the repository at this point in the history
… in autocomplete-js

Fixes #416
  • Loading branch information
Lruihao committed Apr 25, 2024
1 parent 1ed0acd commit f4e8bab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class FixIt {
const results = {};
window._index.search(query).forEach(({ item, refIndex, matches }) => {
let title = item.title;
let content = item.content;
let content = item.content.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
matches.forEach(({ indices, value, key }) => {
if (key === 'content') {
let offset = 0;
Expand Down

0 comments on commit f4e8bab

Please sign in to comment.