Upd. Code. Make patterns for case-insensitivity and improve helper me… - #883
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #883 +/- ##
=========================================
Coverage 30.27% 30.27%
Complexity 6592 6592
=========================================
Files 292 292
Lines 26432 26432
=========================================
Hits 8001 8001
Misses 18431 18431 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, localized, and consistently apply case-insensitive handling for URI schemes; only a minor naming clarity nit was identified.
Pull request overview
This PR updates the contacts-encoding logic to treat mailto: and tel: URI schemes as case-insensitive, improving detection and encoding when clients emit variants like Mailto:/Tel:.
Changes:
- Switched helper scheme checks from
strpos()tostripos()for case-insensitive detection. - Introduced case-insensitive regex scheme fragments (
(?i:mailto):,(?i:tel):) and applied them across the encoder’s phone/email patterns. - Updated scheme stripping in mailto/tel encoders to be case-insensitive (
preg_replace(.../i)).
File summaries
| File | Description |
|---|---|
| lib/Cleantalk/Common/ContactsEncoder/Helper/ContactsEncoderHelper.php | Makes mailto:/tel: detection case-insensitive in helper methods. |
| lib/Cleantalk/Common/ContactsEncoder/ContactsEncoder.php | Applies case-insensitive scheme handling consistently in regex patterns and scheme stripping. |
| lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php | Makes form-field mailto detection case-insensitive before modifying content. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, cohesive, and consistently implement case-insensitive scheme handling without introducing observable logic issues in the affected flows.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
task https://app.doboard.com/1/task/43019