* Pass gateway identity to payment adapters
* Route Stripe webhooks to their originating gateway
* Test Stripe webhook gateway ownership
* Use DBAL for Stripe gateway ownership lookups
* Test DBAL gateway ownership fallbacks
* Harden Stripe webhooks and server manager input
* Add `whsec` to cspell dictionary
Updates `cspell.json` to include `whsec` in the custom words list, preventing it from being flagged as a spelling error.
* Require Stripe webhook secret by mode
* Apply suggested fix to tests/Unit/FOSSBilling/RateLimiterTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/RateLimiterTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/library/Server/Manager/Directadmin.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Api/AbstractApiTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Remove tests path from CODEOWNERS
* Apply suggested fix to src/modules/Order/Service.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix uncancel emails and zero-credit payments
* Preserve orders when invoice generation fails
* Fix RateLimiterTest CI failures from prior autofix commits
- Add a public RateLimiter::getStatus() so tests can read the token
limit for a policy without hardcoding it (getRateLimitState() now
reuses it).
- Fix consumeOrThrow test's toThrow() call: Pest expects the assertion
closure as the first argument (with the exception type-hinted), not
as a second argument alongside the class string.
* Fix DirectAdmin apostrophe entity decoding to avoid trailing semicolon
str_replace(''', "'", $data) also matched the fully-terminated
' entity, replacing just the ' part and leaving the semicolon
behind (e.g. "O'Brien" became "O';Brien"). Replace the terminated
form first, then the legacy unterminated form, so both decode to a
plain apostrophe.
* Fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Use Request object instead of superglobals
* Use Request in locale resolution
* Queue cookies and remove direct header writes
* Fix flaky i18nTest: de_DE locale isn't installed in CI
CI builds with INSTALL_TRANSLATIONS=false, so only en_US exists on
disk and getLocales() never considers de_DE "enabled". Use en_US as
the cookie value (always installed) against a different config
default to still prove the cookie takes precedence.
* Apply suggested fix to tests/Unit/FOSSBilling/RouteMatcherTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/RouteMatcherTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Refresh legacy headers and manifests
* Add Staff Doctrine entities and service fixes
Introduces Doctrine-backed Staff entities/repositories for `admin` and `admin_password_reset`, including lifecycle timestamps and typed lookup helpers. Staff service list retrieval now uses DBAL `fetchAllKeyValue`.
Also refactors Support ticket creation to pass `clientId` instead of loading `Model_Client`, and uses an order lookup by client/order IDs for related ticket data. Product promo failure compensation was tightened to be idempotent by returning early when no redemptions remain and decrementing promo usage by the actual number of removed redemptions. Includes minor import/whitespace/docblock cleanup.
* Fix AdminRepository return type annotation
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix failing timezone alias test to match actual validateTimezone behavior
US/Eastern is a legacy tzdata backward-compatibility alias excluded from
DateTimeZone::listIdentifiers(), so validateTimezone() correctly rejects
it. The test asserted the opposite and failed CI.
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/EdgeCaseRenderingTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/EdgeCaseRenderingTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix incorrect assertion flip in admin ticket edited-message test
The prior "code quality" pass flipped the editMessage2 assertion to
not->toContain, but the admin ticket template renders an edit link for
every admin-authored message regardless of whether it was edited, so
the assertion should remain toContain.
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/EdgeCaseRenderingTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/EdgeCaseRenderingTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Attach PDF invoices to invoice emails (#1724)
Adds generic file-attachment support to the email pipeline (Mail, QueuedEmail,
Email\Service) and wires it into invoice notifications via a new
"Attach PDF Copy to Invoice Emails" setting, so clients who pay by bank
transfer can view the invoice without logging in.
Also carries the same attachment into the sent-email activity log so a
later "resend" (client or admin) reattaches the PDF instead of dropping it.
* Address PR review: avoid blob hydration in email history list, fix checkbox uncheck
- ActivityClientEmailRepository::getSearchQueryBuilder() now selects a partial
entity that excludes attachment_content, so the paginated admin/client email
history list no longer hydrates every PDF into memory just to render
has_attachment. Verified against a real Doctrine EntityManager that the DQL
parses, the generated SQL excludes the blob column, and toApiArray() still
works correctly on the partial entity.
- mod_invoice_settings.html.twig: add the hidden-input-before-checkbox pattern
already used elsewhere in this codebase (e.g. mod_client_new_form.html.twig),
so unchecking "Attach PDF Copy to Invoice Emails" actually persists as
disabled instead of being silently dropped from the form submission.
* Allow admins to edit ticket replies, with edit history (#2317)
Admins previously had no way to fix a typo or correct a reply without
editing the database directly. Adds an Edit action to admin-authored
messages in the admin ticket view; client-authored messages remain
uneditable so an admin can never alter a client's own words.
Every edit snapshots the message's prior content into a new
support_ticket_message_history table before overwriting it, so the
original wording sent to a client is never silently lost. Admins can
view a message's revision history via a lazy-loaded modal.
Also fixes ticket_message_update, which existed but was never wired
into any UI and skipped the markdown sanitization that ticket_reply
already applies.
* Bump fresh-install last_patch to 83
Fresh installs seed last_patch from content.sql so the patcher doesn't
try to reapply migrations already baked into structure.sql. Missed
bumping this when patch83 (support_ticket_message_history) was added.
* Fix message history modal getting stuck on Loading... after a failed fetch
dataset.loaded was set before the API call resolved, so a failed
request left the modal permanently stuck on "Loading..." with no way
to retry short of a page reload. Move the flag to the success
callback and add an error handler that shows a retryable message.
* Make support_ticket_message_history.support_ticket_message_id required
A history row is meaningless without the message it snapshots; allowing
NULL let orphaned rows exist. Tightened the column in patch84,
structure.sql, and the entity's JoinColumn to NOT NULL.
* Delete message edit history when a ticket is removed
Service::rm() explicitly removes a ticket's notes and messages rather
than relying on the entity mapping's onDelete: CASCADE, because this
schema has no real FK constraints anywhere (referential integrity is
handled at the application layer throughout this codebase). History
rows were missed by that pattern and were left orphaned after a ticket
delete. Now removed alongside their message, following the same
explicit-cleanup convention as notes/messages.
Also cache SupportTicketMessageHistoryRepository via setDi(), matching
every other repository on this service, and add direct coverage for
getMessageHistory().
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/Extension/FOSSBillingExtensionTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Twig/Extension/FOSSBillingExtensionTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Previously an email template's "enabled" flag was the only way to control
whether a staff notification (new order, ticket, signup, etc.) went out, and
when enabled it always went to every active staff member. This adds a
per-template staff-group allow-list so notifications can be scoped to the
teams that should actually receive them.
- New email_template_group join table/entity linking templates to admin
groups, with admin API endpoints and a UI card on the template page
mirroring the existing staff-member group management UI.
- Email\Service resolves to_staff recipients from the template's assigned
groups; a template with no groups assigned sends to nobody.
- Existing and newly-created built-in staff templates are auto-linked to
every current staff group (via an UpdatePatcher migration and
createBuiltinTemplateRecord) so upgrades and fresh installs keep today's
"notify everyone" behavior by default.
- Staff\Service::deleteGroup() now blocks removing a group that's still
restricting an email template.
Closes#1247
Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/i18nTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Add per-user timezone support across app
* Bump install DB last_patch to 81
* Address timezone review findings
* Fix uninitialized variable warnings in Email
* Consolidate validation and fix PHPStan variable init
- Hoist the template parse above the recipient dispatch so
$subject/$content are always defined before use (CI PHPStan
caught them as potentially undefined in the elseif branches).
- Address timezone review feedback
* Apply suggested fix to src/modules/Invoice/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Invoice/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Massmailer/Service.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Staff/tests/Unit/Api/AdminTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/ResponseFactoryTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix file/download response content disposition
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Redo and migrate the Admin Group structure
* Update permisison checks to use groups
* Migrate admin group CRUD to Doctrine
* Remove legacy permission and group membership logic
* Replace legacy role logic
* Drop the admin.permissions column
* Only allow super admins to create/edit/delete groups, better guards
* Remove the redundant `admin.protected` column
* Clean group memberships when an admin is deleted
* Make the "Exclude cron user" filter work
* Improve labels
* Addressed code review comments
* Require an initial group
* Improved logger messages
* Replace role subtitle with email
* Bypass permission checks during update finalization to make sure it's accessible
* More sensible default groups
* Update seed content timestamps
* Fixed tests
* Cron login guard
* Addressed code review comments
* Change permission column type to JSON
* Addressed code review comments
* Migrate regular staff to a temporary group and disallow groupless staff management
* Look for Super Administrator or legacy `admin` role
* Fixed tests
* Changed test name to make cspell happy
* Grant required permissions to the groups
---------
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
* Migrate Email, Extension, Support modules to Doctrine ORM
* Add 'initialises' to cspell.json custom words
* Add patch76 and fix extension deactivation event
* Bump database patch version to 76
* Refactor Support APIs to mapped Doctrine flows
* Handle legacy email queue and ticket filters
* Migrate Support module to Doctrine ORM
* Refactor services to use typed repositories
* Route order ticket count and ticket messages through repositories
Drops the last two thin Support\Service wrappers, calling the
SupportTicketRepository and SupportTicketMessageRepository directly
from the cross-module callers.
* Rename email queue table and add patch
* Preserve unlimited email queue processing
* Preserve unlimited email queue processing
* Refactor API request/response HTTP helpers
* Centralize exception and response handling
* Use ResponseEmitter in installer entrypoints
* Add HTTP ResponseFactory and refactor Box_App
* Extract route matching into HTTP matcher
* Fix route param parsing and remove UrlHelper
* Fix exception status code crash and clean up refactor leftovers
ApiResponseFactory::getStatusCode() required an int code, but
Throwable::getCode() can return a string (e.g. PDOException's SQLSTATE),
so any non-FOSSBilling exception with a non-integer code crashed API
error handling with a TypeError instead of returning a JSON error.
Numeric-string codes are normalized to int to preserve prior loose-
comparison behavior; non-numeric codes fall back to the default status.
Also removes now-dead ErrorPage::generatePage(), redundant manual
requires of ResponseEmitter (already covered by composer's classmap
autoload), and duplicate emitResponse() calls in exceptionHandler().
* Handle Stripe invoice.paid webhook and normalize currencies
* Handle Stripe webhooks asynchronously
* Update cspell.json
* Handle all Stripe webhook event types
* Handle Stripe invoice subscription changes
* Handle Stripe subscription race conditions
* Filter Stripe webhook noise
* Handle Stripe subscription races safely
* Improve Stripe subscription creation
* Add 4/5-year periods and new tx statuses
* Harden Stripe dedup for redirect/webhook races
* Address code review findings in Stripe webhook and IPN handler
- Fix: handlePaymentIntentFailedWebhook and handleSetupIntentFailedWebhook
now return true so error transactions are kept rather than written and
immediately deleted; processWebhookEvent guards against overwriting an
existing STATUS_ERROR with STATUS_PROCESSED
- Fix: processInitialSubscriptionPayment reloads the invoice from the DB
before the already-paid guard, consistent with applyOneTimePayment and
narrowing the TOCTOU race window
- Fix: handleInvoicePaymentSucceeded merges two sequential findOne queries
for the same invoice into one, using the result for both the already-paid
check and the billing_reason fallback
- Fix: ipn.php extracts $isJsonWebhook at first evaluation, removing the
duplicate str_contains() expression inside the try block
- Fix: handleSubscriptionCreated casts invoice_id to int, matching all
other handlers; test assertion updated from string '5' to int 5
* Fix double-processing and over-broad exception catch in Stripe adapter
- handleInvoicePaymentSucceeded: set txn_id to the Stripe invoice ID and
check for an existing PROCESSING/PROCESSED transaction with that key so
that when Stripe fires both invoice.payment_succeeded and invoice.paid
for the same payment, the second event is silently skipped rather than
double-crediting the client balance or generating a duplicate renewal
invoice
- processSetupIntent, handleSetupIntentSucceededWebhook: narrow the
ApiErrorException catch to idempotency_key_in_use only; rethrow all
other failures (card declined, auth errors, network issues) so they are
not silently swallowed and processed against an unrelated subscription
* Fix missing Transaction findOne mock in StripeTest fallback test
The handleInvoicePaymentSucceeded dedup check now queries for an
existing Transaction by Stripe invoice ID before processing. The
'falls back to treating unpaid original invoice as initial payment'
test only mocked the Invoice findOne, so the new Transaction query
had no handler and threw NoMatchingExpectationException in CI.
* Fix spellcheck: replace 'Dedup' with 'Duplicate-event' in comment
Apply suggested fix to tests/Unit/FOSSBilling/Twig/StrictVariablesTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Servicehosting/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Servicehosting/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Servicehosting/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Servicehosting/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/modules/Servicehosting/tests/Unit/ServiceTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix hosting service creation test
* Simplify strict variable test assertions
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Apply suggested fix to tests/E2E/Cypress/support/e2e.js from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Migrate the knowledge base to Doctrine
* Addressed code review comments
* Move incrementViews to the repo
* Knowledge base suggestions in support forms
* Improve the UI and make search actually search
* Make the knowledge base enabled on new installs by default
* Redid the kb index to list articles alongside categories
* Display articles in admin manage category
* Redirect authenticated users from guest ticket page to client ticket page
* Address code review comments
* Addressed code review comments
* Improved search accuracy by tokenizing queries
* Updated article layout and added CTAs
* Added a setting to toggle view count's visibility
* Removed contact button from the sidebar
* Migrate canned responses to Doctrine and improve admin UI
* Improved support settings canned dropdowns
* Added a flag to hide view count when serializing
* Improved search query matching
* Migrate SupportHelpdesk to Doctrine
* Fixed tests
* Update copyright headers
* Implemented suggestions (credit @admdly)
* Remove dead test
* fix(support): preserve < and > in ticket/KB messages by using Markdown-safe sanitization
The WYSIWYG editor (CKEditor) uses the Markdown plugin, so ticket replies
and KB article bodies are stored as Markdown, not HTML. Calling the Symfony
HTML Sanitizer on Markdown content silently corrupts it: when a user types
text containing an unknown tag-like string such as `<World>`, the sanitizer
treats it as an unknown HTML element, drops it, and—because there is no
closing tag—also drops everything that follows, causing the rest of the
message to disappear.
Fix by introducing `Tools::sanitizeMarkdownContent()`, which only strips
null bytes and trims whitespace. XSS protection is already provided at
render time by the `|markdown_to_html` Twig filter, whose underlying
CommonMark converter is configured with `html_input: escape`—any raw HTML
inside the stored Markdown is therefore escaped before it reaches the
browser.
Affected endpoints (all now use the new helper):
- Admin: ticket_reply, ticket_create, kb_article_create, kb_article_update
- Client: ticket_create, ticket_reply
- Guest: ticket_create, ticket_reply
Fixes#3827
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBnxaZxj968uFFbgoSocLZ
* fix(spellcheck): use American English spelling "unrecognized"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBnxaZxj968uFFbgoSocLZ
* fix(support): apply markdown-body styling to admin ticket and client KB article views
The admin ticket conversation and client KB article content were rendered
with |markdown_to_html but without the markdown.css stylesheet or the
markdown-body CSS class required by github-markdown-css. This caused
inline code, fenced code blocks, and other Markdown elements to appear
unstyled (admin) or miscontainerised in a list-group div (client KB).
- Admin ticket: load markdown.css in <head> and wrap message content in
<article class="markdown-body bg-transparent text-reset">
- Client KB article: load markdown.css in <head> and replace the
list-group wrapper with <article class="markdown-body bg-transparent
text-reset">
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBnxaZxj968uFFbgoSocLZ
---------
Co-authored-by: Claude <noreply@anthropic.com>