mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
fixed coding style of unicode db detection
This commit is contained in:
parent
a2eaae6102
commit
c07549b6e2
@ -473,7 +473,7 @@
|
||||
//This function is used to add slashes (and decode from UTF-8 if needed)
|
||||
//It's used intensivelly when restoring modules and saving them in db
|
||||
function backup_todb ($data) {
|
||||
if (current_charset() != 'UTF-8') {
|
||||
if (empty($CFG->unicodedb)) {
|
||||
return restore_decode_absolute_links(addslashes(utf8_decode($data)));
|
||||
} else {
|
||||
return restore_decode_absolute_links(addslashes($data));
|
||||
|
@ -4475,7 +4475,7 @@ function display_size($size) {
|
||||
*/
|
||||
function clean_filename($string) {
|
||||
global $CFG;
|
||||
if (empty($CFG->unicodecleanfilename) || current_charset() != 'UTF-8') {
|
||||
if (empty($CFG->unicodecleanfilename) || empty($CFG->unicodedb)) {
|
||||
$textlib = textlib_get_instance();
|
||||
$string = $textlib->specialtoascii($string, current_charset());
|
||||
$string = preg_replace('/[^\.a-zA-Z\d\_-]/','_', $string ); // only allowed chars
|
||||
|
@ -1732,7 +1732,7 @@ require_once "../../lib/xmlize.php";
|
||||
}
|
||||
fclose($h);
|
||||
}
|
||||
if (current_charset() != 'UTF-8') {
|
||||
if (empty($CFG->unicodedb)) {
|
||||
$textlib = textlib_get_instance();
|
||||
$line = $textlib->convert($line, 'UTF-8', current_charset());
|
||||
}
|
||||
@ -1762,7 +1762,7 @@ function glossary_end_tag($tag,$level=0,$endline=true) {
|
||||
//Return the start tag, the contents and the end tag
|
||||
function glossary_full_tag($tag,$level=0,$endline=true,$content) {
|
||||
$st = glossary_start_tag($tag,$level,$endline);
|
||||
if (current_charset() != 'UFT-8') {
|
||||
if (empty($CFG->unicodedb)) {
|
||||
$textlib = textlib_get_instance();
|
||||
$content = $textlib->convert($content, current_charset(), 'UTF-8');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user