private static function parse_headers($raw, $first) { # # first, deal with folded lines # $raw_lines = explode("\r\n", $raw); $lines = array(); $lines[] = array_shift($raw_lines); foreach ($raw_lines as $line) { if (preg_match("!^[ \t]!", $line)) { $lines[count($lines) - 1] .= ' ' . trim($line); } else { $lines[] = trim($line); } } # # now split them out # $out = array($first => array_shift($lines)); foreach ($lines as $line) { list($k, $v) = explode(':', $line, 2); $out[StrToLower($k)] = trim($v); } return $out; }
function jeRobot() { //(funkce převzata z http://seo.nawebu.cz/200301/0287.html) $robot = 0; $agent_test = " " . StrToLower($_SERVER["HTTP_USER_AGENT"]); if (!StrPos($agent_test, "mozilla") && !StrPos($agent_test, "opera") && !StrPos($agent_test, "links") && !StrPos($agent_test, "lynx") && !StrPos($agent_test, "icab") && !StrPos($agent_test, "reqwireless")) { $robot = 1; } else { if (StrPos($agent_test, "@")) { $robot = 1; } if (StrPos($agent_test, "search")) { $robot = 1; } if (StrPos($agent_test, "crawl")) { $robot = 1; } if (StrPos($agent_test, "bot")) { $robot = 1; } if (StrPos($agent_test, "spider")) { $robot = 1; } if (StrPos($agent_test, "jeeves")) { $robot = 1; } } return $robot; }
public static function title2pagename($text) { $znaky = array('á' => 'a', 'é' => 'e', 'ě' => 'e', 'í' => 'i', 'ó' => 'o', 'ú' => 'u', 'ů' => 'u', 'ý' => 'y', 'ž' => 'z', 'š' => 's', 'č' => 'c', 'ř' => 'r', 'Á' => 'A', 'É' => 'E', 'Ě' => 'E', 'Í' => 'I', 'Ó' => 'O', 'Ú' => 'U', 'Ů' => 'U', 'Ý' => 'Y', 'Ž' => 'Z', 'Š' => 'S', 'Č' => 'C', 'Ř' => 'R'); $return = strtr($text, $znaky); $return = Str_Replace(" ", "", $return); //smaze mezery $return = StrToLower($return); //velká písmena nahradí malými. return $return; }
function Get_Active_Extensions() { $arr_extension = array(); foreach ((array) get_option('active_plugins') as $plugin_file) { $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file); if (StrPos(StrToLower($plugin_data['Author']), 'dennis hoppe') !== False) { $arr_extension[$plugin_file] = $plugin_data; } } return $arr_extension; }
function process_dir($pngs, $dir, &$map) { $dh = opendir("{$pngs}/{$dir}"); while ($file = readdir($dh)) { if (preg_match('!^tile_z0_(\\d\\d)_(\\d\\d)\\.png$!', $file, $m)) { $key = StrToLower($dir); $map[$key]["{$m['1']}-{$m['2']}"] = "{$pngs}/{$dir}/{$file}"; } } closedir($dh); }
function useragent_decode($ua){ # # a list of user agents, in order we'll match them. # e.g. we put chrome before safari because chrome also # claims it is safari (but the reverse is not true) # $agents = array( 'chrome', 'safari', 'konqueror', 'firefox', 'netscape', 'opera', 'msie', ); $engines = array( 'webkit', 'gecko', 'trident', ); $ua = StrToLower($ua); $out = array(); $temp = useragent_match($ua, $agents); $out['agent'] = $temp['token']; $out['agent_version'] = $temp['version']; $temp = useragent_match($ua, $engines); $out['engine'] = $temp['token']; $out['engine_version'] = $temp['version']; # # safari does something super annoying, putting the version in the # wrong place like: "Version/5.0.1 Safari/533.17.8" # if ($out['agent'] == 'safari'){ $temp = useragent_match($ua, array('version')); if ($temp['token']) $out['agent_version'] = $temp['version']; } return $out; }
function get_files($directory) { $arr_file = (array) Glob($directory . '{,.}*', GLOB_BRACE); $sort_order = array(); foreach ($arr_file as $index => $file) { $path = RealPath($file); if (!Is_File($path)) { unset($arr_file[$index]); } else { $arr_file[$index] = $path; $sort_order[$index] = StrToLower($file); } } Array_Multisort($sort_order, $arr_file); return $arr_file; }
function CleanUpElem(&$elem_name, &$cfg_file, &$template) { // Fixes HEX strings to look like 0xABCDEF12345 rather than 0Xabc or 0xaf if (Preg_Match("/(0x)([a-fA-F0-9]+)/i", $elem_name, $matches)) { $elem_name = Preg_Replace("/(0x)([a-fA-F0-9]+)/i", "0x" . StrToUpper($matches[2]), $elem_name); } print " Cleaning up elem '{$elem_name}'\n"; $cfg_elem = FindConfigElem($cfg_file, $elem_name); $cfg_elem = array_change_key_case($cfg_elem, CASE_LOWER); $new_elem = array(); $last_label = 0; foreach ($template as $indice => $line) { if (Preg_Match('/\\[Label=([[:alnum:][:space:][:punct:]]+)\\]/', $line, $matches)) { if ($last_label) { unset($new_elem[$last_label]); } $matches[1] = Preg_Replace("/%s/i", " ", $matches[1]); $line = "//{$matches[1]}"; if ($indice > 1) { $line = "\n\t{$line}"; } $last_label = $line; $new_elem[$line] = array(""); continue; } else { $property = StrToLower($line); if ($cfg_elem[$property]) { $new_elem[$line] = $cfg_elem[$property]; unset($cfg_elem[$property]); $last_label = 0; } } } if (Count($cfg_elem) > 0) { $new_elem["\n\t//Custom Values"] = array(""); // Lines not in the template go at the end as custom values foreach ($cfg_elem as $key => $value) { $new_elem[$key] = $value; } } if ($last_label) { unset($new_elem[$last_label]); } return $new_elem; }
function process_dir($pngs, $dir, &$map) { $files = array(); $dh = opendir("{$pngs}/{$dir}"); while ($file = readdir($dh)) { if (preg_match('!^(.*?)_?(\\d\\d)_(\\d\\d)\\.png$!', $file, $m)) { $key = StrToLower($dir . '__' . $m[1]); $map[$key]["{$m['2']}-{$m['3']}"] = "{$pngs}/{$dir}/{$file}"; $files[] = $file; } } closedir($dh); # make preview $out = ""; foreach ($files as $file) { $out .= "<img src=\"{$file}\" style=\"border: 1px solid red\" >\n"; } $fh = fopen("{$pngs}/{$dir}/preview.htm", 'w'); fwrite($fh, $out); fclose($fh); }
static function generate($depth = False) { # Get current Filter string $filter = RawUrlDecode(Get_Query_Var('filter')); if (!empty($filter)) { $str_filter = $filter; } elseif (Is_Singular()) { $str_filter = StrToLower(Get_The_Title()); } else { $str_filter = ''; } # Explode Filter string $arr_current_filter = empty($str_filter) ? array() : PReg_Split('/(?<!^)(?!$)/u', $str_filter); Array_UnShift($arr_current_filter, ''); $arr_filter = array(); # This will be the function result $filter_part = ''; # Check if we are inside a taxonomy archive $taxonomy_term = Is_Tax() ? Get_Queried_Object() : Null; foreach ($arr_current_filter as $filter_letter) { $filter_part .= $filter_letter; $arr_available_filters = self::getFilters($filter_part, $taxonomy_term); if (Count($arr_available_filters) <= 1) { break; } $active_filter_part = MB_SubStr(Implode($arr_current_filter), 0, MB_StrLen($filter_part) + 1); $arr_filter_line = array(); foreach ($arr_available_filters as $available_filter) { $arr_filter_line[$available_filter] = (object) array('filter' => MB_StrToUpper(MB_SubStr($available_filter, 0, 1)) . MB_SubStr($available_filter, 1), 'link' => Post_Type::getArchiveLink($available_filter, $taxonomy_term), 'active' => $active_filter_part == $available_filter, 'disabled' => False); } $arr_filter[] = $arr_filter_line; # Check filter depth limit if ($depth && Count($arr_filter) >= $depth) { break; } } # Run a filter $arr_filter = Apply_Filters('glossary_prefix_filter_links', $arr_filter, $depth); return $arr_filter; }
$Data = $Upload['Data']; #--------------------------------------------------------------------------- if ($gZip = @GzInflate(SubStr($Upload['Data'], 10))) { #------------------------------------------------------------------------- echo "Файл базы данных является сжатым файлом gzip\n"; #------------------------------------------------------------------------- $Data = $gZip; } else { echo "Файл базы данных не является сжатым файлом gzip\n"; } #--------------------------------------------------------------------------- $File = rTrim($Upload['Name'], '.gz'); #--------------------------------------------------------------------------- $File = PathInfo($File); #--------------------------------------------------------------------------- switch (StrToLower($File['extension'])) { case 'xml': #----------------------------------------------------------------------- $Data = String_XML_Parse($Data); if (Is_Exception($Data)) { return SPrintF('Ошибка чтения базы данных: (%s)', $Data->String); } #----------------------------------------------------------------------- break; case 'serialize': #----------------------------------------------------------------------- $Data = UnSerialize($Data); if (!$Data) { return 'Ошибка чтения базы данных'; } #-----------------------------------------------------------------------
public static function select_country() { $id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']); $id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = StrToLower(Substr(chop($id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424[0]), 0, 2)); $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = "44"; if (strlen($id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424) > 0) { $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = SmsVariables::$countryPrefix[$id960ddd9e843150fe4875c48e896395edac7ca1d77cc319b5c0bea76103c0ad59ef40f87a2cd8424]; } return $i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078; }
} } // USER PROPERIES $arResult["UserPropertiesMain"] = array("SHOW" => "N", "DATA" => array()); $arResult["UserPropertiesContact"] = array("SHOW" => "N", "DATA" => array()); $arResult["UserPropertiesPersonal"] = array("SHOW" => "N", "DATA" => array()); if (count($arParams["USER_PROPERTY_MAIN"]) > 0 || count($arParams["USER_PROPERTY_CONTACT"]) > 0 || count($arParams["USER_PROPERTY_PERSONAL"]) > 0) { $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", $arResult["User"]["ID"], LANGUAGE_ID); foreach ($arUserFields as $fieldName => $arUserField) { //echo "<pre>".print_r($arUserField, true)."</pre>"; $arUserField["EDIT_FORM_LABEL"] = StrLen($arUserField["EDIT_FORM_LABEL"]) > 0 ? $arUserField["EDIT_FORM_LABEL"] : $arUserField["FIELD_NAME"]; $arUserField["EDIT_FORM_LABEL"] = htmlspecialcharsEx($arUserField["EDIT_FORM_LABEL"]); $arUserField["~EDIT_FORM_LABEL"] = $arUserField["EDIT_FORM_LABEL"]; $arUserField["PROPERTY_VALUE_LINK"] = ""; if (in_array($arUserField["FIELD_NAME"], $arParams["SONET_USER_PROPERTY_SEARCHABLE"])) { $arUserField["PROPERTY_VALUE_LINK"] = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($arUserField["FIELD_NAME"]) . "=#VALUE#"; } elseif ($bIntranet) { $arUserField['SETTINGS']['SECTION_URL'] = $arParams["PATH_TO_CONPANY_DEPARTMENT"]; } if (in_array($fieldName, $arParams["USER_PROPERTY_MAIN"])) { $arResult["UserPropertiesMain"]["DATA"][$fieldName] = $arUserField; } if (in_array($fieldName, $arParams["USER_PROPERTY_CONTACT"])) { $arResult["UserPropertiesContact"]["DATA"][$fieldName] = $arUserField; } if (in_array($fieldName, $arParams["USER_PROPERTY_PERSONAL"])) { $arResult["UserPropertiesPersonal"]["DATA"][$fieldName] = $arUserField; } } if (count($arResult["UserPropertiesMain"]["DATA"]) > 0) { $arResult["UserPropertiesMain"]["SHOW"] = "Y";
function getHttpResponse($res, $strRequest) { fputs($res, $strRequest); $bChunked = False; while (($line = fgets($res, 4096)) && $line != "\r\n") { if (@preg_match("/Transfer-Encoding: +chunked/i", $line)) { $bChunked = True; } elseif (@preg_match("/Content-Length: +([0-9]+)/i", $line, $regs)) { $length = $regs[1]; } } $strRes = ""; if ($bChunked) { $maxReadSize = 4096; $length = 0; $line = FGets($res, $maxReadSize); $line = StrToLower($line); $strChunkSize = ""; $i = 0; while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) { $strChunkSize .= $line[$i]; $i++; } $chunkSize = hexdec($strChunkSize); while ($chunkSize > 0) { $processedSize = 0; $readSize = $chunkSize > $maxReadSize ? $maxReadSize : $chunkSize; while ($readSize > 0 && ($line = fread($res, $readSize))) { $strRes .= $line; $processedSize += StrLen($line); $newSize = $chunkSize - $processedSize; $readSize = $newSize > $maxReadSize ? $maxReadSize : $newSize; } $length += $chunkSize; $line = FGets($res, $maxReadSize); $line = FGets($res, $maxReadSize); $line = StrToLower($line); $strChunkSize = ""; $i = 0; while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) { $strChunkSize .= $line[$i]; $i++; } $chunkSize = hexdec($strChunkSize); } } elseif ($length) { $strRes = fread($res, $length); } else { while ($line = fread($res, 4096)) { $strRes .= $line; } } return $strRes; }
function fix_case_inner($m) { $data = StrToLower($m[2]); $data = preg_replace_callback('/(^|[^\\w\\s\';,\\-])(\\s*)([a-z])/', create_function('$m', 'return $m[1].$m[2].StrToUpper($m[3]);'), $data); return $m[1] . $data . $m[3]; }
function cff_autolink_email($text, $tagfill = '') { $atom = '[^()<>@,;:\\\\".\\[\\]\\x00-\\x20\\x7f]+'; # from RFC822 #die($atom); $text_l = StrToLower($text); $cursor = 0; $loop = 1; $buffer = ''; while ($cursor < strlen($text) && $loop) { # # find an '@' symbol # $ok = 1; $pos = strpos($text_l, '@', $cursor); if ($pos === false) { $loop = 0; $ok = 0; } else { $pre = substr($text, $cursor, $pos - $cursor); $hit = substr($text, $pos, 1); $post = substr($text, $pos + 1); $fail_text = $pre . $hit; $fail_len = strlen($fail_text); #die("$pre::$hit::$post::$fail_text"); # # substring found - first check to see if we're inside a link tag already... # $bits = preg_split("!</a>!i", $pre); $last_bit = array_pop($bits); if (preg_match("!<a\\s!i", $last_bit)) { #echo "fail 1 at $cursor<br />\n"; $ok = 0; $cursor += $fail_len; $buffer .= $fail_text; } } # # check backwards # if ($ok) { if (preg_match("!({$atom}(\\.{$atom})*)\$!", $pre, $matches)) { # move matched part of address into $hit $len = strlen($matches[1]); $plen = strlen($pre); $hit = substr($pre, $plen - $len) . $hit; $pre = substr($pre, 0, $plen - $len); } else { #echo "fail 2 at $cursor ($pre)<br />\n"; $ok = 0; $cursor += $fail_len; $buffer .= $fail_text; } } # # check forwards # if ($ok) { if (preg_match("!^({$atom}(\\.{$atom})*)!", $post, $matches)) { # move matched part of address into $hit $len = strlen($matches[1]); $hit .= substr($post, 0, $len); $post = substr($post, $len); } else { #echo "fail 3 at $cursor ($post)<br />\n"; $ok = 0; $cursor += $fail_len; $buffer .= $fail_text; } } # # commit # if ($ok) { $cursor += strlen($pre) + strlen($hit); $buffer .= $pre; $buffer .= "<a href=\"mailto:{$hit}\"{$tagfill}>{$hit}</a>"; } } # # add everything from the cursor to the end onto the buffer. # $buffer .= substr($text, $cursor); return $buffer; }
function GetHTTPPage($_257042062, $_86746754, &$_2132833962) { global $SERVER_NAME, $DB; CUpdateClient::AddMessage2Log(___1498308727(1534)); $_1242762492 = COption::$GLOBALS['_____1306963051'][36](___1498308727(1535), ___1498308727(1536), DEFAULT_UPDATE_SERVER); $_2058012254 = round(0 + 40 + 40); $_1995873062 = COption::$GLOBALS['_____1306963051'][37](___1498308727(1537), ___1498308727(1538), ___1498308727(1539)); $_1369122565 = COption::$GLOBALS['_____1306963051'][38](___1498308727(1540), ___1498308727(1541), ___1498308727(1542)); $_957289202 = COption::$GLOBALS['_____1306963051'][39](___1498308727(1543), ___1498308727(1544), ___1498308727(1545)); $_1861132694 = COption::$GLOBALS['_____1306963051'][40](___1498308727(1546), ___1498308727(1547), ___1498308727(1548)); $_68699979 = $GLOBALS['____467353288'][706]($_1995873062) > 892 - 2 * 446 && $GLOBALS['____467353288'][707]($_1369122565) > 960 - 2 * 480; if ($_257042062 == ___1498308727(1549)) { $_257042062 = ___1498308727(1550); } elseif ($_257042062 == ___1498308727(1551)) { $_257042062 = ___1498308727(1552); } elseif ($_257042062 == ___1498308727(1553)) { $_257042062 = ___1498308727(1554); } elseif ($_257042062 == ___1498308727(1555)) { $_257042062 = ___1498308727(1556); } elseif ($_257042062 == ___1498308727(1557)) { $_257042062 = ___1498308727(1558); } elseif ($_257042062 == ___1498308727(1559)) { $_257042062 = ___1498308727(1560); } elseif ($_257042062 == ___1498308727(1561)) { $_257042062 = ___1498308727(1562); } if ($_68699979) { $_1369122565 = IntVal($_1369122565); if ($_1369122565 <= 174 * 2 - 348) { $_1369122565 = round(0 + 26.666666666667 + 26.666666666667 + 26.666666666667); } $_623347571 = $_1995873062; $_681903597 = $_1369122565; } else { $_623347571 = $_1242762492; $_681903597 = $_2058012254; } $_1126662475 = $GLOBALS['____467353288'][708]($_623347571, $_681903597, $_899437029, $_1470493021, round(0 + 40 + 40 + 40)); if ($_1126662475) { $_98669508 = ___1498308727(1563); if ($_68699979) { $_98669508 .= ___1498308727(1564) . $_1242762492 . ___1498308727(1565) . $_257042062 . ___1498308727(1566); if ($GLOBALS['____467353288'][709]($_957289202) > 242 * 2 - 484) { $_98669508 .= ___1498308727(1567) . $GLOBALS['____467353288'][710]($_957289202 . ___1498308727(1568) . $_1861132694) . ___1498308727(1569); } } else { $_98669508 .= ___1498308727(1570) . $_257042062 . ___1498308727(1571); } $_833462016 = self::GetOption(US_BASE_MODULE, ___1498308727(1572), ___1498308727(1573)); $_86746754 .= ___1498308727(1574) . $GLOBALS['____467353288'][711]($_833462016); if ($GLOBALS['____467353288'][712](___1498308727(1575))) { $_86746754 .= ___1498308727(1576) . $GLOBALS['____467353288'][713](___1498308727(1577)); } else { $_86746754 .= ___1498308727(1578) . $GLOBALS['____467353288'][714](___1498308727(1579)); } $_933200987 = $DB->GetVersion(); $_86746754 .= ___1498308727(1580) . $GLOBALS['____467353288'][715]($_933200987 != false ? $_933200987 : ___1498308727(1581)); $_86746754 .= ___1498308727(1582) . COption::$GLOBALS['_____1306963051'][41](___1498308727(1583), ___1498308727(1584), ___1498308727(1585)); $_98669508 .= ___1498308727(1586); $_98669508 .= ___1498308727(1587); $_98669508 .= ___1498308727(1588) . $_1242762492 . ___1498308727(1589); $_98669508 .= ___1498308727(1590); $_98669508 .= ___1498308727(1591); $_98669508 .= ___1498308727(1592) . $GLOBALS['____467353288'][716]($_86746754) . ___1498308727(1593); $_98669508 .= "{$_86746754}"; $_98669508 .= ___1498308727(1594); $GLOBALS['____467353288'][717]($_1126662475, $_98669508); $_724601202 = False; while (!$GLOBALS['____467353288'][718]($_1126662475)) { $_1758870021 = $GLOBALS['____467353288'][719]($_1126662475, round(0 + 2048 + 2048)); if ($_1758870021 != ___1498308727(1595)) { if ($GLOBALS['____467353288'][720](___1498308727(1596), $_1758870021)) { $_724601202 = True; } } else { break; } } $_1501652390 = ___1498308727(1597); if ($_724601202) { $_230052354 = round(0 + 1024 + 1024 + 1024 + 1024); $_968809950 = 1248 / 2 - 624; $_1758870021 = FGets($_1126662475, $_230052354); $_1758870021 = StrToLower($_1758870021); $_1856884664 = ___1498308727(1598); $_774284784 = 882 - 2 * 441; while ($_774284784 < StrLen($_1758870021) && $GLOBALS['____467353288'][721]($_1758870021[$_774284784], array(___1498308727(1599), ___1498308727(1600), ___1498308727(1601), ___1498308727(1602), ___1498308727(1603), ___1498308727(1604), ___1498308727(1605), ___1498308727(1606), ___1498308727(1607), ___1498308727(1608), ___1498308727(1609), ___1498308727(1610), ___1498308727(1611), ___1498308727(1612), ___1498308727(1613), ___1498308727(1614)))) { $_1856884664 .= $_1758870021[$_774284784]; $_774284784++; } $_1345014641 = $GLOBALS['____467353288'][722]($_1856884664); while ($_1345014641 > 1264 / 2 - 632) { $_1593790400 = 1316 / 2 - 658; $_1371628598 = $_1345014641 > $_230052354 ? $_230052354 : $_1345014641; while ($_1371628598 > 952 - 2 * 476 && ($_1758870021 = $GLOBALS['____467353288'][723]($_1126662475, $_1371628598))) { $_1501652390 .= $_1758870021; $_1593790400 += StrLen($_1758870021); $_2114357872 = $_1345014641 - $_1593790400; $_1371628598 = $_2114357872 > $_230052354 ? $_230052354 : $_2114357872; } $_968809950 += $_1345014641; $_1758870021 = FGets($_1126662475, $_230052354); $_1758870021 = FGets($_1126662475, $_230052354); $_1758870021 = StrToLower($_1758870021); $_1856884664 = ___1498308727(1615); $_774284784 = 964 - 2 * 482; while ($_774284784 < StrLen($_1758870021) && $GLOBALS['____467353288'][724]($_1758870021[$_774284784], array(___1498308727(1616), ___1498308727(1617), ___1498308727(1618), ___1498308727(1619), ___1498308727(1620), ___1498308727(1621), ___1498308727(1622), ___1498308727(1623), ___1498308727(1624), ___1498308727(1625), ___1498308727(1626), ___1498308727(1627), ___1498308727(1628), ___1498308727(1629), ___1498308727(1630), ___1498308727(1631)))) { $_1856884664 .= $_1758870021[$_774284784]; $_774284784++; } $_1345014641 = $GLOBALS['____467353288'][725]($_1856884664); } } else { while ($_1758870021 = $GLOBALS['____467353288'][726]($_1126662475, round(0 + 819.2 + 819.2 + 819.2 + 819.2 + 819.2))) { $_1501652390 .= $_1758870021; } } $GLOBALS['____467353288'][727]($_1126662475); } else { $_1501652390 = ___1498308727(1632); if ($GLOBALS['____467353288'][728](___1498308727(1633)) && $GLOBALS['____467353288'][729](___1498308727(1634), ___1498308727(1635))) { $_1470493021 = CUtil::ConvertToLangCharset($_1470493021); } $_2132833962 .= GetMessage(___1498308727(1636)) . ___1498308727(1637) . $_899437029 . ___1498308727(1638) . $_1470493021 . ___1498308727(1639); if (IntVal($_899437029) <= 1100 / 2 - 550) { $_2132833962 .= GetMessage(___1498308727(1640)) . ___1498308727(1641); } CUpdateClient::AddMessage2Log(___1498308727(1642) . $_1242762492 . ___1498308727(1643) . $_899437029 . ___1498308727(1644) . $_1470493021 . ___1498308727(1645), ___1498308727(1646)); } return $_1501652390; }
public static function __TreeItemCompare($a, $b) { if ($a["COMPLEX"] == "Y" && $b["COMPLEX"] == "Y" || $a["COMPLEX"] != "Y" && $b["COMPLEX"] != "Y") { if ($a["SORT"] < $b["SORT"] || $a["SORT"] == $b["SORT"] && StrToLower($a["TITLE"]) < StrToLower($b["TITLE"])) { return -1; } elseif ($a["SORT"] > $b["SORT"] || $a["SORT"] == $b["SORT"] && StrToLower($a["TITLE"]) > StrToLower($b["TITLE"])) { return 1; } else { return 0; } } else { if ($a["COMPLEX"] == "Y") { return -1; } if ($b["COMPLEX"] == "Y") { return 1; } } return 0; }
{ $out = array('ok' => 0, 'error' => $msg); if ($code) { $out['error_code'] = $code; } return $out; } # # Smarty stuff # $GLOBALS['error'] = array(); $GLOBALS['smarty']->assign_by_ref('error', $error); # # Hey look! Running code! Note that db_init will try # to automatically connect to the db_main database # (unless you've disable the 'auto_connect' flag) and # will blow its brains out if there's a problem. # db_init(); if ($this_is_webpage) { login_check_login(); } if (StrToLower($_SERVER['HTTP_X_MOZ']) == 'prefetch') { if (!$GLOBALS['cfg']['allow_precache']) { error_403(); } } # # this timer stores the end of core library loading # $GLOBALS['timings']['init_end'] = microtime_ms();
function GetList(&$by, &$order, $lang = LANGUAGE_ID) { global $DB; global $CACHE_MANAGER; if (defined("CURRENCY_SKIP_CACHE") && CURRENCY_SKIP_CACHE || StrToLower($by) == "name" || StrToLower($by) == "currency" || StrToLower($order) == "desc") { $dbCurrencyList = CFTriggerConditions::__GetList($by, $order, $lang); } else { $by = "sort"; $order = "asc"; $lang = substr($lang, 0, 2); $cacheTime = CURRENCY_CACHE_DEFAULT_TIME; if (defined("CURRENCY_CACHE_TIME")) $cacheTime = intval(CURRENCY_CACHE_TIME); if ($CACHE_MANAGER->Read($cacheTime, "currency_currency_list_".$lang)) { $arCurrencyList = $CACHE_MANAGER->Get("currency_currency_list_".$lang); $dbCurrencyList = new CDBResult(); $dbCurrencyList->InitFromArray($arCurrencyList); } else { $arCurrencyList = array(); $dbCurrencyList = CFTriggerConditions::__GetList($by, $order, $lang); while ($arCurrency = $dbCurrencyList->Fetch()) $arCurrencyList[] = $arCurrency; $CACHE_MANAGER->Set("currency_currency_list_".$lang, $arCurrencyList); $dbCurrencyList = new CDBResult(); $dbCurrencyList->InitFromArray($arCurrencyList); } } return $dbCurrencyList; }
/** возвращается текст ошибки, если таковая была. **/ public static function __GetHTTPPage($page, $strVars, &$strError) { global $SERVER_NAME, $DB; CUpdateClientPartner::AddMessage2Log("exec CUpdateClientPartner::GetHTTPPage"); $ServerIP = COption::GetOptionString("main", "update_site", DEFAULT_UPDATE_SERVER); $ServerPort = 80; $proxyAddr = COption::GetOptionString("main", "update_site_proxy_addr", ""); $proxyPort = COption::GetOptionString("main", "update_site_proxy_port", ""); $proxyUserName = COption::GetOptionString("main", "update_site_proxy_user", ""); $proxyPassword = COption::GetOptionString("main", "update_site_proxy_pass", ""); $bUseProxy = strlen($proxyAddr) > 0 && strlen($proxyPort) > 0; if ($page == "LIST") { $page = "smp_updater_list.php"; } elseif ($page == "STEPM") { $page = "smp_updater_modules.php"; } elseif ($page == "SEARCH") { $page = "smp_updater_search.php"; } elseif ($page == "MODULE") { $page = "smp_updater_actions.php"; } elseif ($page == "REG") { $page = "smp_updater_register.php"; } elseif ($page == "ACTIV") { $page = "us_updater_actions.php"; } $strVars .= "&product=" . (IsModuleInstalled("intranet") ? "CORPORTAL" : "BSM") . "&verfix=2"; if ($bUseProxy) { $proxyPort = IntVal($proxyPort); if ($proxyPort <= 0) { $proxyPort = 80; } $requestIP = $proxyAddr; $requestPort = $proxyPort; } else { $requestIP = $ServerIP; $requestPort = $ServerPort; } $FP = fsockopen($requestIP, $requestPort, $errno, $errstr, 120); if ($FP) { $strRequest = ""; if ($bUseProxy) { $strRequest .= "POST http://" . $ServerIP . "/bitrix/updates/" . $page . " HTTP/1.0\r\n"; if (strlen($proxyUserName) > 0) { $strRequest .= "Proxy-Authorization: Basic " . base64_encode($proxyUserName . ":" . $proxyPassword) . "\r\n"; } } else { $strRequest .= "POST /bitrix/updates/" . $page . " HTTP/1.0\r\n"; } $strRequest .= "User-Agent: BitrixSMUpdater\r\n"; $strRequest .= "Accept: */*\r\n"; $strRequest .= "Host: " . $ServerIP . "\r\n"; $strRequest .= "Accept-Language: en\r\n"; $strRequest .= "Content-type: application/x-www-form-urlencoded\r\n"; $strRequest .= "Content-length: " . strlen($strVars) . "\r\n\r\n"; $strRequest .= "{$strVars}"; $strRequest .= "\r\n"; //CUpdateClientPartner::AddMessage2Log($strRequest, "!!!!!"); fputs($FP, $strRequest); $bChunked = False; while (!feof($FP)) { $line = fgets($FP, 4096); if ($line != "\r\n") { if (preg_match("/Transfer-Encoding: +chunked/i", $line)) { $bChunked = True; } } else { break; } } $content = ""; if ($bChunked) { $maxReadSize = 4096; $length = 0; $line = FGets($FP, $maxReadSize); $line = StrToLower($line); $strChunkSize = ""; $i = 0; while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) { $strChunkSize .= $line[$i]; $i++; } $chunkSize = hexdec($strChunkSize); while ($chunkSize > 0) { $processedSize = 0; $readSize = $chunkSize > $maxReadSize ? $maxReadSize : $chunkSize; while ($readSize > 0 && ($line = fread($FP, $readSize))) { $content .= $line; $processedSize += StrLen($line); $newSize = $chunkSize - $processedSize; $readSize = $newSize > $maxReadSize ? $maxReadSize : $newSize; } $length += $chunkSize; $line = FGets($FP, $maxReadSize); $line = FGets($FP, $maxReadSize); $line = StrToLower($line); $strChunkSize = ""; $i = 0; while ($i < StrLen($line) && in_array($line[$i], array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"))) { $strChunkSize .= $line[$i]; $i++; } $chunkSize = hexdec($strChunkSize); } } else { while ($line = fread($FP, 4096)) { $content .= $line; } } fclose($FP); } else { $content = ""; $strError .= GetMessage("SUPP_GHTTP_ER") . ": [" . $errno . "] " . $errstr . ". "; if (IntVal($errno) <= 0) { $strError .= GetMessage("SUPP_GHTTP_ER_DEF") . " "; } CUpdateClientPartner::AddMessage2Log("Error connecting 2 " . $ServerIP . ": [" . $errno . "] " . $errstr . "", "ERRCONN"); } //CUpdateClientPartner::AddMessage2Log($content, "!1!"); //echo "content:<br>".$content."<br><br>"; return $content; }
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } if (!CModule::IncludeModule("iblock")) { return ShowError(GetMessage("EC_IBLOCK_MODULE_NOT_INSTALLED")); } if (!CModule::IncludeModule("socialnetwork")) { return ShowError(GetMessage("EC_SONET_MODULE_NOT_INSTALLED")); } require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/favorites.php"; $iblockId = Trim($arParams["IBLOCK_ID"]); $taskType = StrToLower($arParams["TASK_TYPE"]); if (!in_array($taskType, array("group", "user"))) { $taskType = "user"; } $ownerId = IntVal($arParams["OWNER_ID"]); if ($ownerId <= 0) { $taskType = "user"; $ownerId = $GLOBALS["USER"]->GetID(); } $ownerId = IntVal($ownerId); $arParams["TASK_VAR"] = Trim($arParams["TASK_VAR"]); if (StrLen($arParams["TASK_VAR"]) <= 0) { $arParams["TASK_VAR"] = "task_id"; } $arParams["GROUP_VAR"] = Trim($arParams["GROUP_VAR"]); if (StrLen($arParams["GROUP_VAR"]) <= 0) { $arParams["GROUP_VAR"] = "group_id"; }
/** * <p>Метод проверяет, может ли пользователь совершать указанную операцию над профайлом заданного пользователя.</p> * * * @param int $fromUserID Код пользователя, права которого проверяются. * * @param int $toUserID Код пользователя, к профайлу которого осуществляется доступ. * * @param string $operation Операция.</bod * * @param bool $bCurrentUserIsAdmin = false Является ли администратором пользователь, права которого * проверяются. Необязательный парамтер. По умолчанию равен false. * * @return bool <p>True, если права на выполнение операции есть. Иначе - false.</p> <br><br> * * @static * @link http://dev.1c-bitrix.ru/api_help/socialnetwork/classes/csocnetuserperms/canperformoperation.php * @author Bitrix */ public static function CanPerformOperation($fromUserID, $toUserID, $operation, $bCurrentUserIsAdmin = false) { global $arSocNetUserOperations; $fromUserID = IntVal($fromUserID); $toUserID = IntVal($toUserID); if ($toUserID <= 0) { return false; } $operation = StrToLower(Trim($operation)); if (!array_key_exists($operation, $arSocNetUserOperations)) { return false; } // use no profile private permission restrictions at the extranet site if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) { return true; } if ($bCurrentUserIsAdmin) { return true; } if ($fromUserID == $toUserID) { return true; } $usersRelation = CSocNetUserRelations::GetRelation($fromUserID, $toUserID); if ($usersRelation == SONET_RELATIONS_BAN && !IsModuleInstalled("im")) { return false; } $toUserOperationPerms = CSocNetUserPerms::GetOperationPerms($toUserID, $operation); if ($toUserOperationPerms == SONET_RELATIONS_TYPE_NONE) { return false; } if ($toUserOperationPerms == SONET_RELATIONS_TYPE_ALL) { return true; } if ($toUserOperationPerms == SONET_RELATIONS_TYPE_AUTHORIZED) { return $fromUserID > 0; } if ($toUserOperationPerms == SONET_RELATIONS_TYPE_FRIENDS || $toUserOperationPerms == SONET_RELATIONS_TYPE_FRIENDS2) { return CSocNetUserRelations::IsFriends($fromUserID, $toUserID); } return false; }
function stem($w) { # load into scope $r =& $GLOBALS['Porter_Stemmer_r']; $step2list =& $GLOBALS['Porter_Stemmer_step2list']; $step3list =& $GLOBALS['Porter_Stemmer_step3list']; $w = StrToLower($w); # # length at least 3 # if (strlen($w) < 3) { return $w; } # # now map initial y to Y so that the patterns never treat it as vowel: # $firstch = substr($w, 0, 1); if ($firstch == 'y') { $w = ucfirst($w); } # # Step 1a # if (preg_match('/(ss|i)es$/', $w)) { $w = Porter_Stemmer::end_chop($w, 2); } else { if (preg_match('/([^s])s$/', $w)) { $w = Porter_Stemmer::end_chop($w, 1); } } # # Step 1b # if (preg_match('/eed$/', $w)) { $pre = Porter_Stemmer::end_chop($w, 3); if (preg_match("/{$r['mgr0']}/", $pre)) { $w = Porter_Stemmer::end_chop($w, 1); } } else { if (preg_match('/(ed|ing)$/', $w, $m1)) { $stem = Porter_Stemmer::end_chop($w, strlen($m1[1])); if (preg_match("/{$r['_v']}/", $stem)) { $w = $stem; if (preg_match('/(at|bl|iz)$/', $w)) { $w .= "e"; } else { if (preg_match('/([^aeiouylsz])\\1$/', $w)) { $w = Porter_Stemmer::end_chop($w, 1); } else { if (preg_match("/^{$r['c2']}{$r['v']}[^aeiouwxy]\$/", $w)) { $w .= "e"; } } } } } } # # Step 1c # if (preg_match('/y$/', $w)) { $stem = Porter_Stemmer::end_chop($w, 1); if (preg_match("/{$r['_v']}/", $stem)) { $w = $stem . "i"; } } # # Step 2 # if (preg_match('/(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/', $w, $m1)) { $suffix = $m1[1]; $stem = Porter_Stemmer::end_chop($w, strlen($suffix)); if (preg_match("/{$r['mgr0']}/", $stem)) { $w = $stem . $step2list[$suffix]; } } # # Step 3 # if (preg_match('/(icate|ative|alize|iciti|ical|ful|ness)$/', $w, $m1)) { $suffix = $m1[1]; $stem = Porter_Stemmer::end_chop($w, strlen($suffix)); if (preg_match("/{$r['mgr0']}/", $stem)) { $w = $stem . $step3list[$suffix]; } } # # Step 4 # if (preg_match('/(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/', $w, $m1)) { $stem = Porter_Stemmer::end_chop($w, strlen($m1[1])); if (preg_match("/{$r['mgr1']}/", $stem)) { $w = $stem; } } else { if (preg_match('/(s|t)(ion)$/', $w, $m1)) { $stem = Porter_Stemmer::end_chop($w, strlen($m1[2])); if (preg_match("/{$r['mgr1']}/", $stem)) { $w = $stem; } } } # # Step 5 # if (preg_match('/e$/', $w)) { $stem = Porter_Stemmer::end_chop($w, 1); $b1 = preg_match("/{$r['mgr1']}/", $stem); $b2 = preg_match("/{$r['meq1']}/", $stem); $b3 = preg_match("/^{$r['c2']}{$r['v']}[^aeiouwxy]\$/", $stem); if ($b1 || $b2 && !$b3) { $w = $stem; } } if (preg_match('/ll$/', $w) && preg_match("/{$r['mgr1']}/", $w)) { $w = Porter_Stemmer::end_chop($w, 1); } # # and turn initial Y back to y # if ($firstch == 'y') { $w = lcfirst($w); } return $w; }
# prepare text: delete tags, begin/end space $Text = trim(Strip_Tags($Article['Text'])); # delete space on string begin $Text = Str_Replace("\n ", "\n", $Text); # delete double spaces $Text = Str_Replace(" ", " ", $Text); # delete carrier return $Text = Str_Replace("\r", "", $Text); # delete many \n $Text = Str_Replace("\n\n", "\n", $Text); # prepare for java script $Text = Str_Replace("\n", '\\n', $Text); # format: /Administrator/Buttons:SortOrder:ImageName.gif # button image, get image name $Partition = explode(":", $Article['Partition']); $Extension = isset($Partition[2]) ? Explode(".", StrToLower($Partition[2])) : ''; # если есть чё-то после точки, и если оно похоже на расширение картинки, ставим это как картинку if (isset($Extension[1]) && In_Array($Extension[1], array('png', 'gif', 'jpg', 'jpeg'))) { #------------------------------------------------------------------------------- $Image = $Partition[2]; #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- # иначе - дефолтовую информационную картинку $Image = 'Info.gif'; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- # делаем кнопку $Comp = Comp_Load('Buttons/Standard', array('onclick' => SPrintF("form.Message.value += '%s'; form.Message.focus();", $Text), 'style' => 'cursor: pointer;'), $Article['Title'], $Image); if (Is_Error($Comp)) {
<?php # # build a map of unified and google codes to the image path # $json = file_get_contents('../../emoji.json'); $data = json_decode($json, true); $map = array(); foreach ($data as $row) { if ($row['unified']) { $map['U_' . StrToLower($row['unified'])] = $row['image']; } if ($row['google']) { $map['G_' . StrToLower($row['google'])] = $row['image']; } } # # now iterate over the known hangouts icons, checking we have a storage path # for each one. # $data = file_get_contents('gmail.html'); preg_match_all('!button string="(.*?)"!', $data, $m); foreach ($m[1] as $code) { $img = '?'; if ($map["U_{$code}"]) { $img = $map["U_{$code}"]; } elseif ($map["G_{$code}"]) { $img = $map["G_{$code}"]; } else { $img = $code . '.png'; }
<?php } ?> <?php if ($endpoint['url']) { ?> <li> API endpoint: <code><?php echo HtmlSpecialChars($endpoint['url']); ?> </code> <?php if (count($endpoint['formats'])) { ?> (only supports <code><?php echo HtmlSpecialChars(StrToLower(implode(', ', $endpoint['formats']))); ?> </code>) <?php } ?> </li> <?php } ?> <?php if ($endpoint['docs_url']) { ?> <li> Documentation: <a href="<?php echo HtmlSpecialChars($endpoint['docs_url']);
break; case 'EMAIL': if ($bIntranet && StrLen($val) > 0) { $val = '<a href="mailto:' . htmlspecialcharsbx($val) . '">' . htmlspecialcharsbx($val) . '</a>'; } else { $val = ''; } break; case 'PERSONAL_WWW': case 'WORK_WWW': if ($val == "http://") { $val = ""; } elseif (StrLen($val) > 0) { $val = htmlspecialcharsbx($val); $valLink = $val; if (StrToLower(SubStr($val, 0, StrLen("http://"))) != "http://") { $valLink = "http://" . $val; } $val = '<a href="' . $valLink . '" target="_blank">' . $val . '</a>'; } break; case 'PERSONAL_COUNTRY': case 'WORK_COUNTRY': if (StrLen($val) > 0) { $val = GetCountryByID($val); } break; case 'PERSONAL_ICQ': if (StrLen($val) > 0) { $val = htmlspecialcharsbx($val) . '<!-- <img src="http://web.icq.com/whitepages/online?icq=' . htmlspecialcharsbx($val) . '&img=5" alt="" />-->'; }
function Soubory($login_uc) { global $kod; global $skupina; echo "<p><h3>Odeslané soubory</h3>"; if($skupina>=20) $podminka = "(vs.id_skup = '$skupina' or vs.id_skup = '-1' or vs.id_skup = '-2')"; else $podminka = "(vs.id_skup = '$skupina' or vs.id_skup = '-2')"; $SQL = " select distinct v.id, v.popis popis, v.datum datum, v.nazev nazev, v.velikost velikost, v.login_uc login_uc, u.jmeno jmeno, u.prijmeni prijmeni, v.trida, v.predmet from soubory_skupiny vs, soubory v, ucitele u where u.login=v.login_uc and v.id = vs.id_soub and v.login_uc = '$login_uc' and $podminka order by v.datum "; if(DB_select($SQL, $vystup, $pocet)) if($pocet>0) { echo "<p><table border=0 cellspacing=2 cellpadding=5>"; echo "<tr><td colspan=3><p><b>Poèet záznamù:</b> $pocet</td></tr>"; echo "<tr bgcolor=\"#dddddd\"><td><center><b>soubor</b></center></td><td> <center><b>tøída</b></center></td><td><center><b>pøedmìt</b></center></td><td><center><b>velikost</b></center></td><td><center><b>datum</b></center></td></tr>"; while($zaz=MySQL_fetch_array($vystup)) { echo "<tr>"; echo "<td valign=\"top\"><dl><dt><a href=\"".c_files.StrToLower($zaz["login_uc"])."/".$zaz["nazev"]."\">".$zaz["nazev"]."</a></dt>"; echo "<dd><small><i>".$zaz["popis"]."</i></small></dd></dl></td>"; echo "<td valign=\"top\"><small>".$zaz["trida"]."</small></td>"; echo "<td valign=\"top\"><small>".$zaz["predmet"]."</small></td>"; echo "<td valign=\"top\"><small>".Prevod($zaz["velikost"])."</small></td>"; echo "<td valign=\"top\"><small>".Datum($zaz["datum"], 0)."</small></td>"; echo "</tr>"; } echo "</table>"; } else echo "<p>".Text_alter("", "nejsou vám urèeny ¾ádné soubory"); }
# prepare for java script $Text = Str_Replace("\n", '\\n', $Text); # format: SortOrder:ImageName.gif # button image, get image name $Partition = Explode(":", $Article['Partition']); $Extension = isset($Partition[1]) ? Explode(".", StrToLower($Partition[1])) : ''; #------------------------------------------------------------------------------- # если есть чё-то после точки, и если оно похоже на расширение картинки, ставим это как картинку $Image = 'Info.gif'; #дефолтовую информационную картинку if (isset($Extension[1]) && In_Array($Extension[1], array('png', 'gif', 'jpg', 'jpeg'))) { $Image = $Partition[1]; } #------------------------------------------------------------------------------- # делаем кнопку, если это системная кнопка или этого админа if (!Preg_Match('/@/', $Partition[0]) && $Partition[0] < 2000 && $__USER['Params']['Settings']['EdeskButtons'] == "No" || StrToLower($Partition[0]) == StrToLower($__USER['Email'])) { #------------------------------------------------------------------------------- $Comp = Comp_Load('Buttons/Standard', array('onclick' => SPrintF("form.Message.value += '%s';form.Message.focus();", $Text), 'style' => 'cursor: pointer;'), $Article['Title'], $Image); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Tr->AddChild(new Tag('TD', $Comp)); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------