Commit 2f1e464a authored by Petr Škoda's avatar Petr Škoda
Browse files

MDL-40438 migrate all collatorlib:: and textlib:: uses

parent e7c21ac3
......@@ -115,7 +115,7 @@
$blocknames[$blockid] = $blockname;
}
}
collatorlib::asort($blocknames);
core_collator::asort($blocknames);
foreach ($blocknames as $blockid=>$strblockname) {
$block = $blocks[$blockid];
......
......@@ -55,7 +55,7 @@ foreach (core_component::get_plugin_list('local') as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
collatorlib::asort($plugins);
core_collator::asort($plugins);
foreach ($plugins as $plugin => $name) {
$uninstall = '';
......
......@@ -103,7 +103,7 @@ if ($form = data_submitted() and confirm_sesskey()) {
$usernames = explode(',', $form->username);
foreach ($usernames as $username) {
$username = trim(textlib::strtolower($username));
$username = trim(core_text::strtolower($username));
if (!empty($username)) {
if (mnet_update_sso_access_control($username, $form->mnet_host_id, $form->accessctrl)) {
if ($form->accessctrl == 'allow') {
......
......@@ -137,8 +137,8 @@ class hub_selector_form extends moodleform {
$options = array();
foreach ($hubs as $hub) {
//to not display a name longer than 100 character (too big)
if (textlib::strlen($hub['name']) > 100) {
$hubname = textlib::substr($hub['name'], 0, 100);
if (core_text::strlen($hub['name']) > 100) {
$hubname = core_text::substr($hub['name'], 0, 100);
$hubname = $hubname . "...";
} else {
$hubname = $hub['name'];
......@@ -287,7 +287,7 @@ class site_registration_form extends moodleform {
$mform->addHelpButton('description', 'sitedesc', 'hub');
$languages = get_string_manager()->get_list_of_languages();
collatorlib::asort($languages);
core_collator::asort($languages);
$mform->addElement('select', 'language', get_string('sitelang', 'hub'),
$languages);
$mform->setType('language', PARAM_ALPHANUMEXT);
......
......@@ -57,7 +57,7 @@ foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
collatorlib::asort($plugins);
core_collator::asort($plugins);
$like = $DB->sql_like('plugin', '?', true, true, false, '|');
$params = array('report|_%');
......
......@@ -99,8 +99,8 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
$shortname = optional_param('shortname', null, PARAM_RAW);
if (!is_null($shortname)) {
$this->role->shortname = $shortname;
$this->role->shortname = textlib::specialtoascii($this->role->shortname);
$this->role->shortname = textlib::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
$this->role->shortname = core_text::specialtoascii($this->role->shortname);
$this->role->shortname = core_text::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
if (empty($this->role->shortname)) {
$this->errors['shortname'] = get_string('errorbadroleshortname', 'core_role');
}
......
......@@ -117,18 +117,18 @@ class tool_uploadcourse_helper {
switch ($block[1]) {
case '+':
$repl = textlib::strtoupper($repl);
$repl = core_text::strtoupper($repl);
break;
case '-':
$repl = textlib::strtolower($repl);
$repl = core_text::strtolower($repl);
break;
case '~':
$repl = textlib::strtotitle($repl);
$repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
$repl = textlib::substr($repl, 0, $block[2]);
$repl = core_text::substr($repl, 0, $block[2]);
}
return $repl;
......
......@@ -57,7 +57,7 @@ class tool_uploadcourse_step1_form extends tool_uploadcourse_base_form {
$mform->setDefault('delimiter_name', 'comma');
}
$choices = textlib::get_encodings();
$choices = core_text::get_encodings();
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploadcourse'), $choices);
$mform->setDefault('encoding', 'UTF-8');
......
......@@ -145,7 +145,7 @@ if (!file_exists($options['file'])) {
}
// Encoding.
$encodings = textlib::get_encodings();
$encodings = core_text::get_encodings();
if (!isset($encodings[$options['encoding']])) {
echo get_string('invalidencoding', 'tool_uploadcourse')."\n";
echo $help;
......
......@@ -183,7 +183,7 @@ function uu_validate_user_upload_columns(csv_import_reader $cir, $stdfields, $pr
$processed = array();
foreach ($columns as $key=>$unused) {
$field = $columns[$key];
$lcfield = textlib::strtolower($field);
$lcfield = core_text::strtolower($field);
if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {
// standard fields are only lowercase
$newfield = $lcfield;
......@@ -295,18 +295,18 @@ function uu_process_template_callback($username, $firstname, $lastname, $block)
switch ($block[1]) {
case '+':
$repl = textlib::strtoupper($repl);
$repl = core_text::strtoupper($repl);
break;
case '-':
$repl = textlib::strtolower($repl);
$repl = core_text::strtolower($repl);
break;
case '~':
$repl = textlib::strtotitle($repl);
$repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
$repl = textlib::substr($repl, 0 , $block[2]);
$repl = core_text::substr($repl, 0 , $block[2]);
}
return $repl;
......
......@@ -53,7 +53,7 @@ class admin_uploaduser_form1 extends moodleform {
$mform->setDefault('delimiter_name', 'comma');
}
$choices = textlib::get_encodings();
$choices = core_text::get_encodings();
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
......
......@@ -75,8 +75,8 @@ class check_oracle_semantics extends XMLDBCheckAction {
// Get current semantic from dictionary, we only will process B (BYTE) ones
// suplying the SQL code to change them to C (CHAR) semantic
$params = array(
'table_name' => textlib::strtoupper($DB->get_prefix() . $xmldb_table->getName()),
'column_name' => textlib::strtoupper($xmldb_field->getName()),
'table_name' => core_text::strtoupper($DB->get_prefix() . $xmldb_table->getName()),
'column_name' => core_text::strtoupper($xmldb_field->getName()),
'data_type' => 'VARCHAR2');
$currentsemantic = $DB->get_field_sql('
SELECT char_used
......
......@@ -57,7 +57,7 @@ foreach (core_component::get_plugin_list('tool') as $plugin => $plugindir) {
}
$plugins[$plugin] = $strpluginname;
}
collatorlib::asort($plugins);
core_collator::asort($plugins);
$like = $DB->sql_like('plugin', '?', true, true, false, '|');
$params = array('tool|_%');
......
......@@ -61,7 +61,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
*/
function user_login ($username, $password) {
$this->connectCAS();
return phpCAS::isAuthenticated() && (trim(textlib::strtolower(phpCAS::getUser())) == $username);
return phpCAS::isAuthenticated() && (trim(core_text::strtolower(phpCAS::getUser())) == $username);
}
/**
......@@ -381,15 +381,15 @@ class auth_plugin_cas extends auth_plugin_ldap {
set_config('ldapencoding', trim($config->ldapencoding), $this->pluginconfig);
set_config('pagesize', (int)trim($config->pagesize), $this->pluginconfig);
set_config('contexts', trim($config->contexts), $this->pluginconfig);
set_config('user_type', textlib::strtolower(trim($config->user_type)), $this->pluginconfig);
set_config('user_attribute', textlib::strtolower(trim($config->user_attribute)), $this->pluginconfig);
set_config('user_type', core_text::strtolower(trim($config->user_type)), $this->pluginconfig);
set_config('user_attribute', core_text::strtolower(trim($config->user_attribute)), $this->pluginconfig);
set_config('search_sub', $config->search_sub, $this->pluginconfig);
set_config('opt_deref', $config->opt_deref, $this->pluginconfig);
set_config('bind_dn', trim($config->bind_dn), $this->pluginconfig);
set_config('bind_pw', $config->bind_pw, $this->pluginconfig);
set_config('ldap_version', $config->ldap_version, $this->pluginconfig);
set_config('objectclass', trim($config->objectclass), $this->pluginconfig);
set_config('memberattribute', textlib::strtolower(trim($config->memberattribute)), $this->pluginconfig);
set_config('memberattribute', core_text::strtolower(trim($config->memberattribute)), $this->pluginconfig);
set_config('memberattribute_isdn', $config->memberattribute_isdn, $this->pluginconfig);
set_config('attrcreators', trim($config->attrcreators), $this->pluginconfig);
set_config('groupecreators', trim($config->groupecreators), $this->pluginconfig);
......@@ -409,7 +409,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
return false;
}
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
// Test for group creator
if (!empty($this->config->groupecreators)) {
......
......@@ -58,8 +58,8 @@ class auth_plugin_db extends auth_plugin_base {
function user_login($username, $password) {
global $CFG, $DB;
$extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
$extpassword = textlib::convert($password, 'utf-8', $this->config->extencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$extpassword = core_text::convert($password, 'utf-8', $this->config->extencoding);
if ($this->is_internal()) {
// Lookup username externally, but resolve
......@@ -176,7 +176,7 @@ class auth_plugin_db extends auth_plugin_base {
function get_userinfo($username) {
global $CFG;
$extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
......@@ -199,7 +199,7 @@ class auth_plugin_db extends auth_plugin_base {
$fields_obj = $rs->FetchObj();
$fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER);
foreach ($selectfields as $localname=>$externalname) {
$result[$localname] = textlib::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
$result[$localname] = core_text::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
}
}
$rs->Close();
......@@ -426,7 +426,7 @@ class auth_plugin_db extends auth_plugin_base {
// Init result value.
$result = false;
$extusername = textlib::convert($username, 'utf-8', $this->config->extencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
......@@ -501,7 +501,7 @@ class auth_plugin_db extends auth_plugin_base {
global $CFG, $DB;
//just in case check text case
$username = trim(textlib::strtolower($username));
$username = trim(core_text::strtolower($username));
// get the current user record
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id));
......@@ -569,7 +569,7 @@ class auth_plugin_db extends auth_plugin_base {
return false;
}
$extusername = textlib::convert($olduser->username, 'utf-8', $this->config->extencoding);
$extusername = core_text::convert($olduser->username, 'utf-8', $this->config->extencoding);
$authdb = $this->db_init();
......@@ -586,7 +586,7 @@ class auth_plugin_db extends auth_plugin_base {
}
$nuvalue = $newuser->$key;
if ($nuvalue != $value) {
$update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(textlib::convert($nuvalue, 'utf-8', $this->config->extencoding))."'";
$update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(core_text::convert($nuvalue, 'utf-8', $this->config->extencoding))."'";
}
}
if (!empty($update)) {
......
......@@ -168,8 +168,8 @@ class auth_plugin_ldap extends auth_plugin_base {
return false;
}
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extpassword = textlib::convert($password, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$extpassword = core_text::convert($password, 'utf-8', $this->config->ldapencoding);
// Before we connect to LDAP, check if this is an AD SSO login
// if we succeed in this block, we'll return success early.
......@@ -250,7 +250,7 @@ class auth_plugin_ldap extends auth_plugin_base {
* @return mixed array with no magic quotes or false on error
*/
function get_userinfo($username) {
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$ldapconnection = $this->ldap_connect();
if(!($user_dn = $this->ldap_find_userdn($ldapconnection, $extusername))) {
......@@ -298,9 +298,9 @@ class auth_plugin_ldap extends auth_plugin_base {
continue; // wrong data mapping!
}
if (is_array($entry[$value])) {
$newval = textlib::convert($entry[$value][0], $this->config->ldapencoding, 'utf-8');
$newval = core_text::convert($entry[$value][0], $this->config->ldapencoding, 'utf-8');
} else {
$newval = textlib::convert($entry[$value], $this->config->ldapencoding, 'utf-8');
$newval = core_text::convert($entry[$value], $this->config->ldapencoding, 'utf-8');
}
if (!empty($newval)) { // favour ldap entries that are set
$ldapval = $newval;
......@@ -351,7 +351,7 @@ class auth_plugin_ldap extends auth_plugin_base {
* @param string $username
*/
function user_exists($username) {
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
// Returns true if given username exists on ldap
$users = $this->ldap_get_userlist('('.$this->config->user_attribute.'='.ldap_filter_addslashes($extusername).')');
......@@ -367,8 +367,8 @@ class auth_plugin_ldap extends auth_plugin_base {
* @param mixed $plainpass Plaintext password
*/
function user_create($userobject, $plainpass) {
$extusername = textlib::convert($userobject->username, 'utf-8', $this->config->ldapencoding);
$extpassword = textlib::convert($plainpass, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($userobject->username, 'utf-8', $this->config->ldapencoding);
$extpassword = core_text::convert($plainpass, 'utf-8', $this->config->ldapencoding);
switch ($this->config->passtype) {
case 'md5':
......@@ -393,7 +393,7 @@ class auth_plugin_ldap extends auth_plugin_base {
}
foreach ($values as $value) {
if (!empty($userobject->$key) ) {
$newuser[$value] = textlib::convert($userobject->$key, 'utf-8', $this->config->ldapencoding);
$newuser[$value] = core_text::convert($userobject->$key, 'utf-8', $this->config->ldapencoding);
}
}
}
......@@ -637,7 +637,7 @@ class auth_plugin_ldap extends auth_plugin_base {
function password_expire($username) {
$result = 0;
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$ldapconnection = $this->ldap_connect();
$user_dn = $this->ldap_find_userdn($ldapconnection, $extusername);
......@@ -735,7 +735,7 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($entry = @ldap_first_entry($ldapconnection, $ldap_result)) {
do {
$value = ldap_get_values_len($ldapconnection, $entry, $this->config->user_attribute);
$value = textlib::convert($value[0], $this->config->ldapencoding, 'utf-8');
$value = core_text::convert($value[0], $this->config->ldapencoding, 'utf-8');
$this->ldap_bulk_insert($value);
} while ($entry = ldap_next_entry($ldapconnection, $entry));
}
......@@ -945,7 +945,7 @@ class auth_plugin_ldap extends auth_plugin_base {
$user->mnethostid = $CFG->mnet_localhost_id;
// get_userinfo_asobj() might have replaced $user->username with the value
// from the LDAP server (which can be mixed-case). Make sure it's lowercase
$user->username = trim(textlib::strtolower($user->username));
$user->username = trim(core_text::strtolower($user->username));
if (empty($user->lang)) {
$user->lang = $CFG->lang;
}
......@@ -991,7 +991,7 @@ class auth_plugin_ldap extends auth_plugin_base {
global $CFG, $DB;
// Just in case check text case
$username = trim(textlib::strtolower($username));
$username = trim(core_text::strtolower($username));
// Get the current user record
$user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id));
......@@ -1040,7 +1040,7 @@ class auth_plugin_ldap extends auth_plugin_base {
function ldap_bulk_insert($username) {
global $DB, $CFG;
$username = textlib::strtolower($username); // usernames are __always__ lowercase.
$username = core_text::strtolower($username); // usernames are __always__ lowercase.
$DB->insert_record_raw('tmp_extuser', array('username'=>$username,
'mnethostid'=>$CFG->mnet_localhost_id), false, true);
echo '.';
......@@ -1053,7 +1053,7 @@ class auth_plugin_ldap extends auth_plugin_base {
* @return boolean result
*/
function user_activate($username) {
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$ldapconnection = $this->ldap_connect();
......@@ -1103,7 +1103,7 @@ class auth_plugin_ldap extends auth_plugin_base {
return null;
}
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$ldapconnection = $this->ldap_connect();
......@@ -1161,7 +1161,7 @@ class auth_plugin_ldap extends auth_plugin_base {
return true;
}
$extoldusername = textlib::convert($olduser->username, 'utf-8', $this->config->ldapencoding);
$extoldusername = core_text::convert($olduser->username, 'utf-8', $this->config->ldapencoding);
$ldapconnection = $this->ldap_connect();
......@@ -1223,9 +1223,9 @@ class auth_plugin_ldap extends auth_plugin_base {
$ambiguous = false;
}
$nuvalue = textlib::convert($newuser->$profilefield, 'utf-8', $this->config->ldapencoding);
$nuvalue = core_text::convert($newuser->$profilefield, 'utf-8', $this->config->ldapencoding);
empty($nuvalue) ? $nuvalue = array() : $nuvalue;
$ouvalue = textlib::convert($olduser->$profilefield, 'utf-8', $this->config->ldapencoding);
$ouvalue = core_text::convert($olduser->$profilefield, 'utf-8', $this->config->ldapencoding);
foreach ($ldapkeys as $ldapkey) {
$ldapkey = $ldapkey;
......@@ -1321,8 +1321,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$result = false;
$username = $user->username;
$extusername = textlib::convert($username, 'utf-8', $this->config->ldapencoding);
$extpassword = textlib::convert($newpassword, 'utf-8', $this->config->ldapencoding);
$extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding);
$extpassword = core_text::convert($newpassword, 'utf-8', $this->config->ldapencoding);
switch ($this->config->passtype) {
case 'md5':
......@@ -1498,13 +1498,13 @@ class auth_plugin_ldap extends auth_plugin_base {
foreach ($userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = textlib::strtolower(trim($this->config->{"field_map_$field"}));
$moodleattributes[$field] = core_text::strtolower(trim($this->config->{"field_map_$field"}));
if (preg_match('/,/', $moodleattributes[$field])) {
$moodleattributes[$field] = explode(',', $moodleattributes[$field]); // split ?
}
}
}
$moodleattributes['username'] = textlib::strtolower(trim($this->config->user_attribute));
$moodleattributes['username'] = core_text::strtolower(trim($this->config->user_attribute));
return $moodleattributes;
}
......@@ -1555,7 +1555,7 @@ class auth_plugin_ldap extends auth_plugin_base {
$users = ldap_get_entries_moodle($ldapconnection, $ldap_result);
// Add found users to list.
for ($i = 0; $i < count($users); $i++) {
$extuser = textlib::convert($users[$i][$this->config->user_attribute][0],
$extuser = core_text::convert($users[$i][$this->config->user_attribute][0],
$this->config->ldapencoding, 'utf-8');
array_push($fresult, $extuser);
}
......@@ -1696,7 +1696,7 @@ class auth_plugin_ldap extends auth_plugin_base {
// (according to my reading of RFC-1945, RFC-2616 and RFC-2617 and
// my local tests), so we need to convert the REMOTE_USER value
// (i.e., what we got from the HTTP WWW-Authenticate header) into UTF-8
$username = textlib::convert($_SERVER['REMOTE_USER'], 'iso-8859-1', 'utf-8');
$username = core_text::convert($_SERVER['REMOTE_USER'], 'iso-8859-1', 'utf-8');
switch ($this->config->ntlmsso_type) {
case 'ntlm':
......@@ -1715,7 +1715,7 @@ class auth_plugin_ldap extends auth_plugin_base {
return false; // Should never happen!
}
$username = textlib::strtolower($username); // Compatibility hack
$username = core_text::strtolower($username); // Compatibility hack
set_cache_flag($this->pluginconfig.'/ntlmsess', $sesskey, $username, AUTH_NTLMTIMEOUT);
return true;
}
......@@ -1924,7 +1924,7 @@ class auth_plugin_ldap extends auth_plugin_base {
// Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).
$config->contexts = explode(';', $config->contexts);
$config->contexts = array_map(create_function('$x', 'return textlib::strtolower(trim($x));'),
$config->contexts = array_map(create_function('$x', 'return core_text::strtolower(trim($x));'),
$config->contexts);
$config->contexts = implode(';', array_unique($config->contexts));
......@@ -1934,8 +1934,8 @@ class auth_plugin_ldap extends auth_plugin_base {
set_config('ldapencoding', trim($config->ldapencoding), $this->pluginconfig);
set_config('pagesize', (int)trim($config->pagesize), $this->pluginconfig);
set_config('contexts', $config->contexts, $this->pluginconfig);
set_config('user_type', textlib::strtolower(trim($config->user_type)), $this->pluginconfig);
set_config('user_attribute', textlib::strtolower(trim($config->user_attribute)), $this->pluginconfig);
set_config('user_type', core_text::strtolower(trim($config->user_type)), $this->pluginconfig);
set_config('user_attribute', core_text::strtolower(trim($config->user_attribute)), $this->pluginconfig);
set_config('search_sub', $config->search_sub, $this->pluginconfig);
set_config('opt_deref', $config->opt_deref, $this->pluginconfig);
set_config('preventpassindb', $config->preventpassindb, $this->pluginconfig);
......@@ -1943,15 +1943,15 @@ class auth_plugin_ldap extends auth_plugin_base {
set_config('bind_pw', $config->bind_pw, $this->pluginconfig);
set_config('ldap_version', $config->ldap_version, $this->pluginconfig);
set_config('objectclass', trim($config->objectclass), $this->pluginconfig);
set_config('memberattribute', textlib::strtolower(trim($config->memberattribute)), $this->pluginconfig);
set_config('memberattribute', core_text::strtolower(trim($config->memberattribute)), $this->pluginconfig);
set_config('memberattribute_isdn', $config->memberattribute_isdn, $this->pluginconfig);
set_config('creators', trim($config->creators), $this->pluginconfig);
set_config('create_context', trim($config->create_context), $this->pluginconfig);
set_config('expiration', $config->expiration, $this->pluginconfig);
set_config('expiration_warning', trim($config->expiration_warning), $this->pluginconfig);
set_config('expireattr', textlib::strtolower(trim($config->expireattr)), $this->pluginconfig);
set_config('expireattr', core_text::strtolower(trim($config->expireattr)), $this->pluginconfig);
set_config('gracelogins', $config->gracelogins, $this->pluginconfig);
set_config('graceattr', textlib::strtolower(trim($config->graceattr)), $this->pluginconfig);
set_config('graceattr', core_text::strtolower(trim($config->graceattr)), $this->pluginconfig);
set_config('auth_user_create', $config->auth_user_create, $this->pluginconfig);
set_config('forcechangepassword', $config->forcechangepassword, $this->pluginconfig);
set_config('stdchangepassword', $config->stdchangepassword, $this->pluginconfig);
......
......@@ -1222,7 +1222,7 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
// replay the upgrade step 2010080901 - updating question image
if (!empty($data['image'])) {
if (textlib::substr(textlib::strtolower($data['image']), 0, 7) == 'http://') {
if (core_text::substr(core_text::strtolower($data['image']), 0, 7) == 'http://') {
// it is a link, appending to existing question text
$data['questiontext'] .= ' <img src="' . $data['image'] . '" />';
......
......@@ -1233,7 +1233,7 @@ class moodle1_file_manager implements loggable {
}
$filepath = clean_param($filepath, PARAM_PATH);
if (textlib::strlen($filepath) > 255) {
if (core_text::strlen($filepath) > 255) {
throw new moodle1_convert_exception('file_path_longer_than_255_chars');
}
......
......@@ -204,7 +204,7 @@ abstract class backup_plan_dbops extends backup_dbops {
global $DB;
// Calculate backup word
$backupword = str_replace(' ', '_', textlib::strtolower(get_string('backupfilename')));
$backupword = str_replace(' ', '_', core_text::strtolower(get_string('backupfilename')));
$backupword = trim(clean_filename($backupword), '_');
// Not $useidonly, lets fetch the name
......@@ -228,7 +228,7 @@ abstract class backup_plan_dbops extends backup_dbops {
break;
}
$shortname = str_replace(' ', '_', $shortname);
$shortname = textlib::strtolower(trim(clean_filename($shortname), '_'));
$shortname = core_text::strtolower(trim(clean_filename($shortname), '_'));
}
// The name will always contain the ID, but we append the course short name if requested.
......@@ -240,7 +240,7 @@ abstract class backup_plan_dbops extends backup_dbops {
// Calculate date
$backupdateformat = str_replace(' ', '_', get_string('backupnameformat', 'langconfig'));
$date = userdate(time(), $backupdateformat, 99, false);
$date = textlib::strtolower(trim(clean_filename($date), '_'));
$date = core_text::strtolower(trim(clean_filename($date), '_'));
// Calculate info
$info = '';
......
......@@ -554,7 +554,7 @@ abstract class backup_cron_automated_helper {
return true;
}
$backupword = str_replace(' ', '_', textlib::strtolower(get_string('backupfilename')));
$backupword = str_replace(' ', '_', core_text::strtolower(get_string('backupfilename')));
$backupword = trim(clean_filename($backupword), '_');
if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment