Open sephentos opened 1 month ago
@sephentos Thank you for raising this issue. We are aware of the deprecations and will take care of them in the future. Unfortunately I cannot give a fixed date for this just yet.
@yeneastgate @dai-eastgate Please investigate this further and give me your assessment and possible solutions. The deprecations do not break anything therefore do not have the highest priority.
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in [redacted]/wp-content/plugins/onoffice-for-wp-websites/plugin/FormPostHandler.php on line 82
@fredericalpers @sephentos Currently, the documentation suggests using the htmlspecialchars() function instead. However, htmlspecialchars() only converts special characters to HTML entities and does not strip tags, which may not fully address the issue.
Additionally, there's a deprecation notice:
Deprecated: Return type of onOffice\WPlugin\ArrayContainer::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [redacted]/wp-content/plugins/onoffice-for-wp-websites/plugin/ArrayContainer.php on line 59
To address this, I added a return type for cases where the return type is bool. For return types like mixed or void, the notice can only be suppressed, as adding a return type would cause severe errors in versions lower than PHP 8.1
I have temporarily implemented a solution to hide the notices and created a PR #935 for issue.
Please take a look at my demo video and let me know your opinions. Thank you!
I could not find any information about the supported PHP versions, other than the info "PHP 7.4 or higher". Therefore, I would just like to informally pass on that I receive the following deprecated notices under PHP 8.3.
Plugin v5.1.2 with WP 6.6.2 is being used. Messages appearing on all pages.
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in [redacted]/wp-content/plugins/onoffice-for-wp-websites/plugin/FormPostHandler.php on line 82
Deprecated: Return type of onOffice\WPlugin\ArrayContainer::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in [redacted]/wp-content/plugins/onoffice-for-wp-websites/plugin/ArrayContainer.php on line 59