fix: #3605529 Guard realpath() against FALSE in getKeyValue() so a missing private key file does not fatal
Fixes [#3605529].
getKeyValue() called dirname($this->fileSystem->realpath($path)) directly. realpath() returns FALSE when the private key file is missing, and dirname(false) throws a TypeError under PHP 8, fataling any page that runs easy_encryption_requirements() (e.g. /admin/config).
This guards both realpath() results against FALSE before dirname(), and coerces the parent delegations to a string so the method never returns NULL against its : string return type.
Not a duplicate of [#3575553] (Closed (fixed), 1.0.0-rc6, in 1.0.3), which fixed the key generation path; this is the key read path.
AI-Generated: Yes (Used Claude Code to draft the guard and the issue/MR text; reviewed and verified by the contributor.)
Checkpoints
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Documentation
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release Notes
- Release
Edited by Rajab Natshah