fixed coding style of unicode db detection

This commit is contained in:
skodak 2006-03-06 20:30:00 +00:00
parent a2eaae6102
commit c07549b6e2
3 changed files with 4 additions and 4 deletions

View File

@ -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));

View File

@ -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

View File

@ -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');
}