mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
line&bar chart subtitles are always sanitized
This obviates bug 726449 for consistency
This commit is contained in:
@@ -135,24 +135,6 @@
|
||||
(define gnc:html-barchart-subtitle
|
||||
(record-accessor <html-barchart> 'subtitle))
|
||||
|
||||
;; Note: Due to Bug726449 the input string's non-printable control
|
||||
;; characters must translated to HTML format tags BEFORE
|
||||
;; or WHEN calling this function.
|
||||
;; AND:
|
||||
;; To ensure that the generated subtitle doesn't contain any
|
||||
;; unescaped quotes or backslashes, all strings must be freed
|
||||
;; from those by calling gnc:html-string-sanitize.
|
||||
;; Otherwise we're opening the gates again for bug 721768.
|
||||
;;
|
||||
;; Example: "\n" must be translated to "<br /> to introduce
|
||||
;; a line break into the chart subtitle.
|
||||
;;
|
||||
;; Example call:
|
||||
;; (gnc:html-barchart-set-subtitle! chart
|
||||
;; (string-append "Bgt:"
|
||||
;; (gnc:html-string-sanitize (number->string bgt-sum))
|
||||
;; "<br /> Act:" ;; line break in the chart sub-title
|
||||
;; (gnc:html-string-sanitize (number->string act-sum))))
|
||||
(define gnc:html-barchart-set-subtitle!
|
||||
(record-modifier <html-barchart> 'subtitle))
|
||||
|
||||
|
||||
@@ -205,14 +205,12 @@
|
||||
};\n")
|
||||
|
||||
(if title
|
||||
(begin
|
||||
(push " options.title = \"")
|
||||
(push title) (push "\";\n")))
|
||||
(push (format #f " options.title = ~s;\n"
|
||||
(gnc:html-string-sanitize title))))
|
||||
|
||||
(if subtitle
|
||||
(begin
|
||||
(push " options.title += \" (")
|
||||
(push subtitle) (push ")\";\n")))
|
||||
(push (format #f " options.title += ' (' + ~s + ')';\n"
|
||||
(gnc:html-string-sanitize subtitle))))
|
||||
|
||||
(if (and (string? x-label) (> (string-length x-label) 0))
|
||||
(begin
|
||||
|
||||
@@ -237,14 +237,8 @@
|
||||
(gnc:html-barchart-append-column! chart act-vals)
|
||||
(gnc:html-barchart-set-row-labels! chart date-iso-string-list)
|
||||
(if running-sum
|
||||
(gnc:html-barchart-set-subtitle! chart
|
||||
(string-append "Bgt:"
|
||||
(gnc:html-string-sanitize (number->string bgt-sum))
|
||||
"<br /> Act:"
|
||||
(gnc:html-string-sanitize (number->string act-sum))
|
||||
)
|
||||
)
|
||||
)
|
||||
(gnc:html-barchart-set-subtitle!
|
||||
chart (format #f "Bgt: ~a Act: ~a" bgt-sum act-sum)))
|
||||
)
|
||||
;; else
|
||||
(begin
|
||||
@@ -253,14 +247,9 @@
|
||||
(gnc:html-linechart-append-column! chart act-vals)
|
||||
(gnc:html-linechart-set-row-labels! chart date-iso-string-list)
|
||||
(if running-sum
|
||||
(gnc:html-linechart-set-subtitle! chart
|
||||
(string-append "Bgt:"
|
||||
(gnc:html-string-sanitize (number->string bgt-sum))
|
||||
"<br /> Act:"
|
||||
(gnc:html-string-sanitize (number->string act-sum))
|
||||
)
|
||||
)
|
||||
)
|
||||
(gnc:html-linechart-set-subtitle!
|
||||
chart
|
||||
(format #f "Bgt: ~a Act: ~a" bgt-sum act-sum)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user