Sheernox
New Member
Env: ClientExec 7.3.0 stable (ionCube), PHP 8.5.12, MariaDB 11.8.9. Found on our production install, 2026-11-18; reproduced on staging the same day.
Where: the admin invoice save (fuse=billing, controller=invoice, action=saveinvoice; encoded, so no line is cited) and the values it hands the views:
Bug: Saving an invoice stores an apostrophe in the note as ' and a double quote as " (HTML tags are stripped; the ampersand is kept). The value then reaches both views escaped once more, so staff see "The client's note" in the textarea and the client sees the same text on the invoice page. The PDF invoice decodes it correctly. The encoding does not compound on a later unchanged re-save. Any note written in plain English (possessives, contractions, quoted terms) reaches the client with visible entity codes.
Repro:
Fix: Store the note as typed (escape on output, not on input), and escape it once when printing it into the textarea and the client invoice.
Where: the admin invoice save (fuse=billing, controller=invoice, action=saveinvoice; encoded, so no line is cited) and the values it hands the views:
templates/admin/views/billing/invoice/invoice.phtml lines 265-268 print the note into the "Notes visible to client" textarea, and templates/default/views/billing/invoicepublic/invoice.phtml lines 240-243 print invoiceNotes. Both templates echo the value as given.Bug: Saving an invoice stores an apostrophe in the note as ' and a double quote as " (HTML tags are stripped; the ampersand is kept). The value then reaches both views escaped once more, so staff see "The client's note" in the textarea and the client sees the same text on the invoice page. The PDF invoice decodes it correctly. The encoding does not compound on a later unchanged re-save. Any note written in plain English (possessives, contractions, quoted terms) reaches the client with visible entity codes.
Repro:
- Billing, create an invoice for any client, add a line, and enter: The client's "quoted" note, under Notes visible to client. Save.
- The invoice note column holds The client's "quoted" note, and reopening the invoice shows that text in the textarea.
- Open the invoice as the client: the Notes section shows the same entity codes. View PDF Invoice shows the note correctly.
Fix: Store the note as typed (escape on output, not on input), and escape it once when printing it into the textarea and the client invoice.