Development Guides Home >> Guide to Locales >> Bracket Notation
To use a custom bracket notation method, you must add it to the bracket notation method whitelist. To prevent the execution of arbitrary or malicious code when the locale system processes a localized string, cPanel & WHM only allows specific bracket notation methods by default.
You can create custom output methods. For more information, read CPAN's Locale::Maketext::Utils documentation.
The locale system automatically blacklists methods that begin with the underscore character (_) and methods that include Perl namespace separator characters.
cPanel & WHM ships with the following bracket notation method whitelist:
asisbooleancommentcurrent_yeardatetimeformat_bytesget_locale_nameget_user_locale_nameis_definedis_futurejoinlist_andlist_and_quotedlist_orlist_or_quotednumeratenumfoutputquant
For more information about these methods, read our Guide to Locales - Bracket Notation Methods documentation.
To add a new bracket notation method to the whitelist, perform the following steps:
- Create the
/var/cpanel/maketext_whitelistfile with0644permissions. - In your preferred text editor, add each new bracket notation method to the file, with one method name per line.
For example, to add the get_language_tag and convert methods to the whitelist, create a /var/cpanel/maketext_whitelist file with the following contents:
get_language_tag
convert