8000 fix(security): escape SMS text written to order notes by kzamanbd · Pull Request #166 · getdokan/texty · GitHub
[go: up one dir, main page]

Skip to content

fix(security): escape SMS text written to order notes - #166

Merged
kzamanbd merged 1 commit into
developfrom
fix/escape-sms-order-notes
Nov 30, 2026
Merged

kzamanbd merged 1 commit into
developfrom
fix/escape-sms-order-notes

Conversation

@kzamanbd
@kzamanbd kzamanbd commented Nov 27, 2026 •
Copy link
Copy Markdown
Contributor

Summary

SMS text can include customer-supplied values (e.g. {billing_name}). Texty stored that text unescaped in private WooCommerce order notes, which are rendered as HTML on the admin order screen and the Dokan vendor dashboard.

This PR escapes the note text before it is saved. The SMS body sent to the gateway is unchanged.

  • Closes getdokan/texty-pro#58

Changes

  • includes/Notifications/WC/Base.php: new Base::escape_note() helper (esc_html, @since TEXTY_VERSION); add_sms_note() uses it, covering all automatic WC notifications.
  • includes/OrderSms.php: add_note() escapes the stored note too. The content returned to the order-screen box stays plain text, since it is appended with textContent.

Notes

  • Notes written by earlier versions stay as stored; no migration in this PR.
  • Note text returned by the WC order-notes REST endpoint is now entity-encoded.

Testing

  • composer phpcs passes
  • Enable a customer order notification, place an order with HTML in the billing name, open the order: the note shows it as literal text
  • Manual order SMS from the order screen: the note shows the same, and the appended note in the box reads correctly

SMS text can contain customer-supplied values such as {billing_name}.
It was stored unescaped in private order notes, which are rendered as
HTML on the order screen and the Dokan vendor dashboard. Escape the
note text with esc_html() via a new Base::escape_note() helper in both
the notification note and the manual order SMS note. The SMS body sent
to the gateway is unchanged.
@kzamanbd kzamanbd self-assigned this Nov 27, 2026
@kzamanbd
kzamanbd merged commit fd9eda0 into develop Nov 30, 2026
2 checks passed
@kzamanbd
kzamanbd deleted the fix/escape-sms-order-notes branch November 30, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0