calc: escape the Date Calculator labels (escHtml); CHANGELOG v2.6.1

Completes the v2.6.0 escaping pass: the From/to description labels go through escHtml at the
date-menu render, the Print Date Durations label swap, and the restore after the image export.
Cache-bust bumps for the three scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
malonehunterandClaude Opus 5.5 committed 2026-10-07 06:08:39 -04:00
1 parent 7d76b1f550
commit d025c7e810
5 files changed
+16 -9

No files matched your search

+7
View File
@@ -1,5 +1,12 @@
# Changelog
## v2.6.1
### Security
- **Date Calculator labels are escaped (`escHtml`).** The From/to description fields were written
into the page as HTML when the date menu redrew and around *Print Date Durations*; they now render
as literal text, completing the v2.6.0 escaping pass. No database or settings changes.
## v2.6.0
### Security
+2 -2
View File
@@ -191,9 +191,9 @@ function toggleDateCalcMenu() {
o += '<div class="dateCalcBg">'
o += '<table class="dateCalcTable2"><tbody>'
o += '<tr style="line-height: 0.9em;"><td><div id="dateDesc1Area"><input class="dateDescription" id="dateDesc1" value="'+dateDesc1Saved+'"></div></td></tr>' // Date 1 label
o += '<tr style="line-height: 0.9em;"><td><div id="dateDesc1Area"><input class="dateDescription" id="dateDesc1" value="'+escHtml(dateDesc1Saved)+'"></div></td></tr>' // Date 1 label
o += '<tr style="line-height: 0.9em;"><td style="padding-bottom: 0.5em;"><span id="d1full_t2" class="dateDetailsText"></span></td></tr>' // Date 1
o += '<tr style="line-height: 0.9em;"><td><div id="dateDesc2Area"><input class="dateDescription" id="dateDesc2" value="'+dateDesc2Saved+'"></div></td></tr>' // Date 2 label
o += '<tr style="line-height: 0.9em;"><td><div id="dateDesc2Area"><input class="dateDescription" id="dateDesc2" value="'+escHtml(dateDesc2Saved)+'"></div></td></tr>' // Date 2 label
o += '<tr style="line-height: 0.9em;"><td style="padding-bottom: 0.5em;"><span id="d2full_t2" class="dateDetailsText"></span></td></tr>' // Date 2
o += '<tr><td style="background: var(--menu-bg-accent); padding: 0.4em 0.75em 0.5em 0.75em;"><span id="dateDurValues" class="dateDetailsText"></span></td></tr>'
o += '</tbody></table>'
+2 -2
View File
@@ -20,8 +20,8 @@ function openImageWindow(element, imgName = "", sRatio = window.devicePixelRatio
imageDataURL = trimCanvas(canvas); // canvas to "data:image/png;base64, ..."
if (element == '.dateCalcTable2') { // restore date labels as input
$('#dateDesc1Area').html('<input class="dateDescription" id="dateDesc1" value="'+dateDesc1Saved+'">')
$('#dateDesc2Area').html('<input class="dateDescription" id="dateDesc2" value="'+dateDesc2Saved+'">')
$('#dateDesc1Area').html('<input class="dateDescription" id="dateDesc1" value="'+escHtml(dateDesc1Saved)+'">')
$('#dateDesc2Area').html('<input class="dateDescription" id="dateDesc2" value="'+escHtml(dateDesc2Saved)+'">')
$('.dateCalcTable2').removeClass('elemBorderScr') // add outline
}
+2 -2
View File
@@ -331,8 +331,8 @@ $(document).ready(function(){
openImageWindow(".HistoryTable", fileName, 2.0);
});
$("body").on("click", "#btn-date-calc-png", function () {
$('#dateDesc1Area').html('<span class="dateDescription">'+dateDesc1Saved+'</span>') // input to fixed text
$('#dateDesc2Area').html('<span class="dateDescription">'+dateDesc2Saved+'</span>')
$('#dateDesc1Area').html('<span class="dateDescription">'+escHtml(dateDesc1Saved)+'</span>') // input to fixed text
$('#dateDesc2Area').html('<span class="dateDescription">'+escHtml(dateDesc2Saved)+'</span>')
$('.dateCalcTable2').addClass('elemBorderScr') // add outline
// phrase-with-spaces_2021-03-26_10-23-52_table.png
var fileName = (saved_d1.getMonth()+1)+'-'+saved_d1.getDate()+'-'+saved_d1.getFullYear()+'_'+
+3 -3
View File
@@ -17,7 +17,7 @@
<script src="calc/gematria.js?v=3"></script>
<script src="calc/calc.js?v=17"></script>
<script src="calc/init-variables.js?v=8"></script>
<script src="calc/init-variables.js?v=9"></script>
<script src="calc/ciphers.js?v=6"></script>
<link rel="stylesheet" type="text/css" href="calc/styles.css?v=10" />
@@ -149,11 +149,11 @@
<script src="calc/breakdown.js?v=4"></script>
<script src="calc/highlighter.js?v=3"></script>
<script src="calc/export.js?v=3"></script>
<script src="calc/export.js?v=4"></script>
<script src="calc/export-csv.js?v=3"></script>
<script src="calc/num-prop.js?v=2"></script>
<script src="calc/edit-ciphers.js?v=2"></script>
<script src="calc/date-calc.js?v=2"></script>
<script src="calc/date-calc.js?v=3"></script>
<script src="calc/database.js?v=9"></script>
<script src="calc/quick-guide.js?v=2"></script>