I see intermittent use of filter="safehtml"
and filter="string"
throught Joomla forms. Is there a complete list, and can custom filters be created?
1 Answer
The possible filters are:
- rules (Access Control Rules)
- unset (Do nothing, thus leaving the return value as null)
- raw (No filter)
- int_array (Filter the input as an array of integers)
- safehtml (Filter safe HTML)
- server_utc (Convert a date to UTC based on the server timezone offset)
- user_utc (Convert a date to UTC based on the user timezone offset)
- url (URL filter which also ensure the protocol is present)
- tel (Filter for phone number. It will try and match against specific patterns, else return a string of numbers)
For a full list of jInput filters and how to use them, see Retrieving request data using JInput.
Hope this helps
-
Where did you get/find this? Am looking at
joomla\libraries\filter\input.php
, and see some from your list and others that you haven't included.– GDPCommented Dec 22, 2014 at 20:57 -
1Have a look here: github.com/joomla/joomla-cms/blob/master/libraries/joomla/form/…– LodderCommented Dec 22, 2014 at 20:58
-
-
1No worries. As for the custom filters, you can most likely create your own by extending the class, but have never tried this.– LodderCommented Dec 22, 2014 at 21:05
-
1In joomla 3.9.24 unit tests suite on the official joomla-cms repo you can find some more filter type such as php custom function, php custom method, word, and int here is the link github.com/joomla/joomla-cms/blob/3.9.24/tests/unit/suites/… Commented Apr 2, 2021 at 23:16