Файл: vsime.com/system/functions/output_text.php
Строк: 28
<?
    function my_esc($str)
    {
        global $dbi;
            return mysqli_real_escape_string($dbi, $str);
    }
    
    function output_text($str,$user_id, $bbs=NULL, $br=1, $html=1, $smiles=1, $links=1, $bbcode=1)
    {
        $unique_perem = 'ddd845g4lg384nf390483v';`'"dddd//??```~~82(*@*(73^(^@#$%^&*()_)(*&^%';
        $ank = profile($user_id);
        if ($html)$str=htmlentities($str, ENT_QUOTES, 'UTF-8'); // преобразуем все к нормальному перевариванию браузером
        if ($smiles)$str = text_smiles($str, $ank['id']); // вставка смайлов
        if ($bbcode)
        {
            $str = bbcode($str, $bbs, $links); // обработка bbcode
        }
        if ($br)
        {
            $str=br($str); // переносы строк
        }
        $str = str_replace("$unique_perem<br />", "", $str);
        $str = str_replace("$unique_perem", "", $str);
        return stripslashes($str); // возвращаем обработанную строку
    }
    // для форм
    function input_value($str)
    {
        return output_text($str,0, 0, 0, 1 , 0, 0, 0);
    }
    
    function br($msg, $br='<br />') // переносы строк
    {
        return preg_replace("#((<br( ?/?)>)|n|r)+#i",$br, $msg);
    }
    function esc($text, $br=NULL) // Вырезает все нечитаемые символы
    {
        if ($br!=NULL)
        for ($i=0;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);
        else
        {
            for ($i=0;$i<10;$i++)$text=str_replace(chr($i), NULL, $text);
            for ($i=11;$i<20;$i++)$text=str_replace(chr($i), NULL, $text);
            for ($i=21;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);
        }
        return $text;
    }
?>