/**
* This method transliterates a string into a URL
* safe string or returns a URL safe UTF-8 string
* based on the global configuration
*
* @param string $string String to process
* @param string $language Language to transliterate to if unicode slugs are disabled
*
* @return string Processed string
*
* @since 3.2
*/
public static function stringURLSafe($string, $language = '')
{
if (Factory::getApplication()->get('unicodeslugs') == 1) {
$output = OutputFilter::stringUrlUnicodeSlug($string);
} else {
if ($language === '*' || $language === '') {
$languageParams = ComponentHelper::getParams('com_languages');
$language = $languageParams->get('site');
}
$output = OutputFilter::stringURLSafe($string, $language);
}
return $output;
}