* 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>
* Fix duplicate domain activation caused by stale order object
Cart checkout can activate an order that was already activated
synchronously via an invoice paid with account credit, since the
in-memory order held by the checkout loop is never refreshed after
the credit-payment path activates it through its own freshly-loaded
copy. activateOrder() now re-fetches the order before checking its
status, closing the gap that let EPP domain registration run twice
and fail with "Domain is not available: In use".
* Treat already-active orders as a no-op in activateOrder
The reload alone turned the stale-order race into a thrown exception
for orders that were already correctly activated by another code
path in the same request. Cart::checkoutCart()'s catch block then
tried to record an 'error' order status, which isn't a valid status
and threw a second exception that broke the whole checkout. An
already-active order (without force) should just be a no-op success.
* Update src/modules/Order/Service.php
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
PR #3863 migrated the Extension module to Doctrine and removed
Service::findExtension(), but missed three call sites in
UpdatePatcher.php that still used it. Users upgrading from 0.6.x
hit "Call to undefined method ...findExtension()" when these
update patches ran.
* Fix GET fetch body and DRY DirectAdmin fields
* Remove unused bindings in Support module
* Gate dashboard invoice and order cards
* Extract and test data-fb-api parser
* Refactor API helpers and add unit tests
* Extract link action and loading state helpers
* Refactor icon checks into tested helpers
* Refactor frontend helpers and slim tests
* Harden API CSRF handling and icon checks
* Fix crash on Product Promotions page for promo rows with NULL flags
The `promo` table's maxuses/used/freesetup/once_per_client/recurring/
active columns are nullable in the DB, but the Doctrine entity mapped
them as non-nullable typed properties. When a row (typically from a
legacy install) has NULL in one of these columns, Doctrine's
TypedNoDefaultPropertyAccessor unsets the property instead of applying
the PHP default, so any read throws "must not be accessed before
initialization" — crashing the admin Product Promotions page.
Align the entity mapping with the actual nullable schema and coalesce
null to the intended defaults in the getters and toApiArray().
Fixes#3942
* Coalesce NULL used counts in promo usage SQL
promoCanBeApplied() now treats a NULL used column as 0, but
PromoRepository's raw SQL for incrementing/decrementing usage did not:
`used + 1` and `GREATEST(used - ?, 0)` both propagate NULL in MySQL,
and `maxuses > used` is unknown (never true) when used IS NULL. That
let checkout accept a legacy promo with a NULL used count and then
immediately fail to reserve it, throwing "maximum number of uses
reached". Coalesce used to 0 in both the SET and WHERE clauses so
reservation matches what promoCanBeApplied() already allows.
Apply suggested fix to src/themes/admin_default/html/mod_index_dashboard.html.twig 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 src/themes/admin_default/html/mod_index_dashboard.html.twig 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/themes/admin_default/html/mod_index_dashboard.html.twig 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.
* Speed up CI: share Docker test image, dedupe PHPStan, fix cache contention
live-tests and cypress-tests each independently rebuilt the same PHP 8.5
test image already built by the php-build-test matrix, paying for a
registry-cache pull each time. Build it once, export it as a workflow
artifact, and have live-tests/cypress-tests just docker load it.
PHPStan analyzes source, not runtime behavior, so running it identically
across all 3 PHP versions in the matrix was pure duplication. Now it runs
once, on PHP 8.3.
php-build-test-push and preview-build-push wrote to the shared GHCR
registry cache on every push to every branch, not just main. Concurrent
branch pushes (including frequent bot autofix branches) could stomp on
each other's cache entries, degrading hit rates for everyone. Cache
writes are now restricted to main; other branches read-only, same as the
existing PR path.
* Trim comment verbosity to match existing workflow style
The repo's existing workflow comments are single-line "why" notes; tighten
the multi-line ones added in the previous commit to match, and drop an
unused step id.
* Apply suggested fix to src/library/Payment/Adapter/PayPalEmail.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/Payment/Adapter/PayPalEmail.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/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>
* Apply suggested fix to src/library/Payment/Adapter/PayPalEmail.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/Payment/Adapter/PayPalEmail.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix syntax error from orphaned brace in PayPalEmail adapter
A prior autofix commit closed the `payment_status == 'Completed'` if-block
early with an else/break, but left the block's original closing brace in
place, breaking the rest of the switch statement.
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/library/Payment/Adapter/PayPalEmail.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/Payment/Adapter/PayPalEmail.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/Payment/Adapter/PayPalEmail.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/Payment/Adapter/PayPalEmail.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>
PayPal can resend/duplicate the subscr_signup IPN for a subscription,
and the handler had no idempotency check before creating a new
Subscription row (unlike subscr_payment, which is well-guarded). This
could result in duplicate subscription records and duplicate renewal
notifications, matching reports on issue #3055.
* 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>