mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Change the moodle_strtolower() function to use textlib services.
Also, mark it as deprecated, code should use text services directly. Partially, bug 5777. It continues under investigation. (http://moodle.org/bugs/bug.php?op=show&bugid=5777) Merged from MOODLE_16_STABLE
This commit is contained in:
parent
318192731e
commit
c0bd060a58
1 changed files with 9 additions and 8 deletions
|
@ -5975,17 +5975,18 @@ function moodle_setlocale($locale='') {
|
||||||
* @param string $encoding The encoding on the string.
|
* @param string $encoding The encoding on the string.
|
||||||
* @return string
|
* @return string
|
||||||
* @todo Add examples of calling this function with/without encoding types
|
* @todo Add examples of calling this function with/without encoding types
|
||||||
|
* @deprecated Use textlib->strtolower($text, current_charset()) instead.
|
||||||
*/
|
*/
|
||||||
function moodle_strtolower ($string, $encoding='') {
|
function moodle_strtolower ($string, $encoding='') {
|
||||||
if (function_exists('mb_strtolower')) {
|
|
||||||
if($encoding===''){
|
//If not specified, get the current encoding
|
||||||
return mb_strtolower($string); //use multibyte support with default encoding
|
if (empty($encoding)) {
|
||||||
} else {
|
$encoding = current_charset();
|
||||||
return mb_strtolower($string, $encoding); //use given encoding
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return strtolower($string); // use common function what rely on current locale setting
|
|
||||||
}
|
}
|
||||||
|
//Use text services
|
||||||
|
$textlib = textlib_get_instance();
|
||||||
|
|
||||||
|
return $textlib->strtolower($string, $encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue