I want to override JFilterInput class on Joomla. The file is on below path:
[Joomla_Path]/libraries/joomla/filter/input.php
Because this file developed just for non-Unicode characters.So it shows
Notice: Array to string conversion
on line 233 in many components like com_finder that uses this class for Unicode characters. That line is:
$result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source);
for this reason I wanted to override this line and same others. firstly I developed a Joomla system plugin to override this file with onAfterRoute() method but by following this post in stackexchange I changed onAfterRoute() method to onAfterInitialise() method. But again it shows below fatal error:
Fatal error: Cannot redeclare class JFilterInput
Now I'm looking forward to get helps from everybody which solve this problem. in addition, I use last version of Joomla
onAfterInitialiseis the event used once the framework has dispatched the application. MeaningJFilterInputalready exists, which is why you're getting the errorCannot redeclare class JFilterInput. Rather than trying to redefine the class, try extending it