Тема: php-mbstring
Показать сообщение отдельно

  #3  
Старый 22.11.2009, 05:49
#Wolf#
Постоянный
Регистрация: 26.03.2008
Сообщений: 311
С нами: 9540826

Репутация: 479
По умолчанию

нашел эту строку, портящую всю жизнь)
PHP код:
function sanitize_title_with_dashes($title) {
    
$title = strip_tags($title);
    
$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
    
$title = str_replace('%', '', $title);
$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);

    
$title = remove_accents($title);
    if (
seems_utf8($title)) {
        
/*if (function_exists('mb_strtolower')) {
            $title = mb_strtolower($title,'UTF-8');  <------------------
        }*/
        
$title = utf8_uri_encode($title, 200);
    }

    
$title = strtolower($title);
    
$title = preg_replace('/&.+?;/', '', $title); 
    
$title = str_replace('.', '-', $title);
    
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
    
$title = preg_replace('/\s+/', '-', $title);
    
$title = preg_replace('|-+|', '-', $title);
    
$title = trim($title, '-');

    return 
$title;
} 
 
Ответить с цитированием