Skip to content

Commit

Permalink
Use encodeURIComponent() for path components.
Browse files Browse the repository at this point in the history
  • Loading branch information
t-paul committed Dec 24, 2023
1 parent 357a812 commit 81821df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion advent-calendar-2023/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
div = document.getElementById("day-" + day);
data = days.get("day" + day);
if (data) {
div.style.backgroundImage = 'url(' + url + data.dir + '/' + data.img + ')';
div.style.backgroundImage = 'url(' + url + encodeURIComponent(data.dir) + '/' + encodeURIComponent(data.img) + ')';
}
}
var modal = document.getElementById("modal");
Expand Down

0 comments on commit 81821df

Please sign in to comment.