Releases: dereuromark/cakephp-tools
Releases · dereuromark/cakephp-tools
3.13.1
Fixes
- Restore the entity generic on the
Tablebase class, so IdeHelper-generated Table subclass annotations and entity-typed finder return types resolve under PHPStan again (#334)
Improvements
- Port the LoginLink authenticator and identifier to cakephp/authentication v4 and declare a conflict with older majors (
<4.0.0), so the plugin can no longer be paired with an incompatible authentication version (#335)
Full Changelog: 3.13.0...3.13.1
3.13.0
Fixes
- Honor camelCase DataPreparation.noTrim config key (#329)
Features
- Tokens can now persist per-type validity windows on each row, so login links, password resets, API tokens, and similar flows can expire differently without retroactively changing already-issued tokens (#332)
Full Changelog: 3.12.9...3.13.0
3.12.9
Fixes
- Gravatar now uses SHA-256, encryption is idempotent, and
pregMatch()no longer splices UTF-8 incorrectly (#326) PasswordHasherFactorynow resolves app- and plugin-provided password hashers instead of being locked to theToolsplugin prefix, while still keeping the built-inDefaulthasher safe from being silently shadowed (#328)
Full Changelog: 3.12.8...3.12.9
3.12.8
Fixes
- Stop rendering the
titleattribute unescaped inFormatHelper::neighbors(). The link options forcedescape => false, which in CakePHPHtmlHelperdisables escaping of both the link text and attribute values, so thetitleattribute rendered raw from arbitrary DB content (XSS surface). Switched toescapeTitle => falseso the icon HTML stays in the link text but attributes escape normally. Regression test covers<script>and&"payloads in title-field values. - Tighten the HTTP status check in
Tools\Model\Table\Table::_validUrl(). Both ternary branches returned'HTTP', and the[(200|301|302)]regex used a character class instead of an alternation — so it matched any status line containing one of( 0 1 2 3 |). Replaced with a hardcodedHTTP/prefix and real(200|301|302)/(404|999)alternations.
Improvements
- Pagination element is now CSP-compatible. The per-page limit
<select>no longer carries an inlineonchange="window.location.href=this.value"handler — replaced with adata-paginator-navigateattribute and a small delegatedchangelistener at the bottom of the element. The accompanying<script>block carries a CSP nonce sourced from thecspNoncerequest attribute, so apps with a strictscript-src 'self' 'nonce-...'policy can run it; falls back gracefully when no nonce is set. (Inline event handlers are blocked under strict CSP withoutunsafe-inline/unsafe-hashes, and the nonce directive does not cover them per the CSP spec — removing the attribute entirely is the only portable fix.) - Switched all remaining bare
__()calls in user-facing strings to__d('tools', ...)so translations resolve through the plugin's own i18n domain instead of leaking into the host app'sdefaultdomain. Affects four static labels intemplates/Admin/Helper/{chars,bitmasks}.phpand four dynamic title/icon strings inIconCollection,CommonHelper, andFormatHelper. Also refreshesresources/locales/tools.pot(the previous POT was ~6 years stale); existing language files are left for translators tomsgmergeagainst the new POT.
Full Changelog: 3.12.7...3.12.8
3.12.7
Fixes
- Enforce validity window in
TokensTable::useKey(). Previously an unused token stayed redeemable past its configured validity until the garbage collector ran — a real gap for magic-login, email-verification, and password-reset style flows.useKey()now rejects tokens wherecreated < now - validityunless marked unlimited.
Improvements
- Forward
TEntitytemplate throughTools\Model\Table\Tableso subclasses can type their entity for PHPStan. Requiresdereuromark/cakephp-shim3.8.4+ and CakePHP 5.3.4+.
Full Changelog: 3.12.6...3.12.7
3.12.6
Fixes
- Fix
autoPrefixUrl()callingurlExists()with invalid URL when input already hashttps://protocol
Full Changelog: 3.12.5...3.12.6
3.12.5
Fixes
-
Add timeout to
urlExists()cURL request (#315)CURLOPT_TIMEOUT(5s) - total request timeoutCURLOPT_CONNECTTIMEOUT(3s) - connection timeoutCURLOPT_FOLLOWLOCATIONwithMAXREDIRS(3) - follow redirectscurl_close()- properly clean up handle
-
Add timeout to remaining HTTP requests (#316)
Utility::urlExists()fallback: 5s stream context timeoutUtility::getHeaderFromUrl(): 5s timeoutMime::getMimeTypeByUrl(): 5s timeoutMessage::_readFile(): 10s timeout
-
Fix
autoPrefixUrl()callingurlExists()with invalid URL- URLs with
https://are now returned as-is - URLs with
http://are properly upgraded by replacing the prefix - Prevents invalid URLs like
https://https://example.com
- URLs with
This prevents requests from hanging indefinitely when servers don't respond.
3.12.4
Improvements
- Use
ServerRequest::clientIp()instead ofenv('REMOTE_ADDR')for proper proxy header handling
Full Changelog: 3.12.3...3.12.4
3.12.3
Fixes
- Fix page action URLs to use dasherized format instead of camelCase
Enhancements
- Add dynamic
scopeandonDirtyoptions to SluggedBehavior
Full Changelog: 3.12.2...3.12.3
3.12.2
Improvements
- Fix CakePHP 5.3.0 behavior method deprecations - #310
- Add uniqueCallback option to SluggedBehavior - #312
Full Changelog: 3.12.1...3.12.2