Details
-
Type: Sub-task
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.8.0-b1
-
Component/s: None
-
Labels:None
Description
The PHPIDS library was deprecated several years ago and is no longer updated, so it is not compatible with PHP 8.
When generating a report, it always returns an empty result:.
IDS_Report Object ( [events:protected] => Array ( ) [tags:protected] => Array ( ) [impact:protected] => 0 [centrifuge:protected] => Array ( ) )
There are a few approaches we can adopt for this plugin:
- Fork the PHPIDS repository and update it to be compatible with PHP 8.1
- Replace the PHPIDS library with a drop-in replacement, such as "Expose", however this one has not been updated for quite a while as well.
- Re-write the plugin using a more up-to-date library, such as "Defence".
- Deprecate the plugin and remove it in a future version.
Error:
preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated
Affected Files:
- /plugins/phpids/lib/IDS/Converter.php (Line 334)
Possible solution:
Replace null by an empty string on the second parameter of preg_replace().
Error:
During inheritance return type should be compatible
Affected Files:
- /plugins/phpids/lib/IDS/Report.php (Line 214)
- /plugins/phpids/lib/IDS/Event.php (Line 211)
Possible solution:
Add the "#[\ReturnTypeWillChange]" attribute to all the methods of the affected classes.