diff --git a/edit_form.php b/edit_form.php index 30b5c75..968708b 100644 --- a/edit_form.php +++ b/edit_form.php @@ -102,13 +102,8 @@ public function definition () { $mform->setDefault('secret', md5(uniqid(rand(), 1))); $mform->addRule('secret', get_string('required'), 'required'); - if (class_exists('textlib')) { - $textlib = new textlib(); - } else { - $textlib = textlib_get_instance(); - } - $choices = $textlib->get_encodings(); + $choices = core_text::get_encodings(); $mform->addElement('select', 'encoding', get_string('remoteencoding', 'local_ltiprovider'), $choices); $mform->setDefault('encoding', 'UTF-8'); @@ -220,4 +215,4 @@ public function validation($data, $files) { return $errors; } -} \ No newline at end of file +} diff --git a/tool.php b/tool.php index 7804b3d..1e0e0f9 100644 --- a/tool.php +++ b/tool.php @@ -227,17 +227,11 @@ // Transform to utf8 all the post and get data - if (class_exists('textlib')) { - $textlib = new textlib(); - } else { - $textlib = textlib_get_instance(); - } - foreach ($_POST as $key => $value) { - $_POST[$key] = $textlib->convert($value, $tool->encoding); + $_POST[$key] = core_text::convert($value, $tool->encoding); } foreach ($_GET as $key => $value) { - $_GET[$key] = $textlib->convert($value, $tool->encoding); + $_GET[$key] = core_text::convert($value, $tool->encoding); } // We need an username without extended chars