Open
Description
Fix Deprecated Warning for trim()
on Null Values
Description
This issue tracks a PHP 8.1+ deprecation warning caused by passing null
to trim()
in the redirect()
function. The error message is:
PHP Deprecated: trim(): Passing null to parameter ($string) of type string is deprecated
Steps to Reproduce
- Use PHP 8.1 or later.
- Activate the Simple 301 Redirects plugin.
- Observe the deprecated warning in logs.
Proposed Fix
- Ensure that
$userrequest
and$storedrequest
are cast to(string)
before callingtrim()
. - A pull request has been created to fix this: #20.
Impact
- ✅ Eliminates the deprecation notice.
- ✅ Improves compatibility with newer PHP versions.
Related PR: #20
Metadata
Metadata
Assignees
Labels
No labels