Skip to content

Commit daa6a02

Browse files
committed
fix: encode after truncating to avoid splitting HTML entities (wh-etb.2)
left(encodeForHTML(x), 100) could split an HTML entity like & into &am, producing malformed output. Reversed to encodeForHTML(left(x, 100)) so truncation happens on raw text before encoding.
1 parent b18a284 commit daa6a02

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cli/src/models/AdminViewService.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ component {
205205
return h & 'timeFormat(' & qv & ', "HH:nn:ss")' & h;
206206
}
207207

208-
// Text / textarea — truncate in list view
208+
// Text / textarea — truncate in list view (encode after truncating to avoid splitting HTML entities)
209209
if (field.inputType == "textarea" || field.dataType == "text") {
210-
return h & "left(encodeForHTML(" & qv & "), 100)" & h;
210+
return h & "encodeForHTML(left(" & qv & ", 100))" & h;
211211
}
212212

213213
// Default — encode for safety

0 commit comments

Comments
 (0)