Skip to content

Backport the package audit fixes to 8.3.x - #24

Merged
MoamenEltouny merged 11 commits into
8.3.xfrom
backport/audit-findings-8.3.x
Dec 1, 2026
Merged

MoamenEltouny merged 11 commits into
8.3.xfrom
backport/audit-findings-8.3.x

Conversation

@MoamenEltouny

Copy link
Copy Markdown
Member

Summary

Backports the package audit fixes from #21 to the 8.3.x line, for release as 8.3.2.

Changes

  • Large rule sets work again. Rules beyond PCRE's pattern size limit (about 3,500 short rules) were silently ignored; they are now split into patterns that still run as one pass, longest match first.
  • Ukrainian override on PCRE2 10.45+. A caseless \p{Lu} matches every cased letter from PCRE2 10.45, so Щастя came out as SHCHastia. The upper-case checks now switch caseless matching off.
  • Tooling. Pest 4 (with the PHPUnit 12.5.8 security floor), Pint with the per preset instead of PHP_CodeSniffer, and PHPStan 2 at level max on src/ with no errors. composer check validates, checks formatting, analyses, tests and audits. Every PHP file declares strict types.
  • Structure. Support\CamelCase and Support\Locale move to Normalization\CamelCase and Localization\Locale (still @internal). Facades\Slugify is a supported alias rather than deprecated.
  • CI, baseline and docs as in Fix the package audit findings on 8.0.x #21: gated stages behind a Quality gate, the template's repository files, and the upgrade guide as the last docs page with a 8.3.2 - Unreleased changelog entry.
  • Tests. Data providers are static and declared with #[DataProvider] attributes, as PHPUnit 12 requires, and SecurityTest passes only the argument its validity test takes (as on 8.4.x). The docs gain an upgrade page, which this line did not have.

Compatibility

No public API removed and no default slug output changed, except that rule sets too large for one pattern are now applied instead of ignored. The moved helpers were @internal.

RuleSet compiled all search strings into a single alternation. Past
PCRE's pattern size limit (about 3,500 short rules) the pattern failed
to compile, PHP emitted a warning and every rule was silently skipped.

The alternation is now split into patterns that compile, and apply()
runs them as one pass with the same earliest-then-longest match rule,
so a replacement is still never re-processed.
Support/ is not allowed in Pharaonic packages. CamelCase joins the other
text stages as Normalization\CamelCase, and Locale, which parses locale
codes and loads the per-locale overrides, becomes Localization\Locale.
Both stay @internal.
The compatibility forms and the common replacements are loaded with
typed results, so src passes PHPStan at level max.
The Ukrainian override detects upper-case neighbours with \p{Lu} inside
a caseless pattern. From PCRE2 10.45 a caseless \p{Lu} matches every
cased letter, so mixed-case words came out as SHCHastia instead of
Shchastia. The upper-case checks now switch caseless matching off.
The 2.x import path stays on every release line, so it is no longer
marked deprecated.
Tests run on Pest 4 (with the PHPUnit 12.5.8 security floor), Pint with
the per preset replaces PHP_CodeSniffer, and PHPStan 2 analyses src at
level max. Data providers are static, declared with attributes and pass
exactly the arguments each test takes, as PHPUnit 12 requires. Composer
scripts follow the Pharaonic baseline: composer check validates, checks
formatting, analyses, tests and audits.
Strict mode governs calls and returns inside the package's own files,
so callers keep their own coercion mode.
Validate, style, analyse, tests (Linux and Windows, lowest and highest
dependencies, plus one job without intl), security audit and an archive
check run in order with fail-fast, and a Quality gate job fails unless
every stage succeeded. Third-party actions are pinned to commit SHAs,
develop and manual runs are covered, and workflow changes are no longer
skipped. A labels workflow syncs .github/labels.yml.
Adds MAINTAINING.md, SUPPORT.md, the labels specification and the
documentation issue form, and takes the PR template, Dependabot
configuration, issue labels, Git metadata, README and code of conduct
from the Pharaonic template. CONTRIBUTING describes the new checks.
The docs gain an upgrade guide, last in the sidebar, covering patch
releases, moving between PHP lines and upgrading from 2.x. The API
reference documents the removeRule() no-op and the facade alias, and
the changelog gains an 8.3.2 entry.
@MoamenEltouny MoamenEltouny self-assigned this Dec 1, 2026
@MoamenEltouny
MoamenEltouny merged commit a821026 into 8.3.x Dec 1, 2026
12 checks passed
@MoamenEltouny
MoamenEltouny deleted the backport/audit-findings-8.3.x branch December 1, 2026 15:19
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