function dlfile($urlfrom, $urlto, $timeout = 30) { global $checksum, $metcms_v; $post_data = array('urlfrom' => $urlfrom, 'checksum' => $checksum, 'metcms_v' => $metcms_v); $result = curl_post($post_data, $timeout); $link = link_error($result); if ($link != 1) { return $link; } if (substr($result, -7) == 'metinfo') { $result = substr($result, 0, -7); if ($urlto) { $return = file_put_contents($urlto, $result); if (!$return) { return link_error('No filepower'); } else { return 1; } } else { return $result; } } else { return link_error('Timeout'); } }
$physical_web = $physical_web == null ? "-1" : $physical_web; /*网站扫描*/ $physical_file = ""; if ($physicaldo[11] == 1) { require_once $depth . '../../include/export.func.php'; $met_file = '/dl/standard.php'; $query = "select * from {$met_app} where download=1"; $app = $db->get_all($query); $applist = ''; foreach ($app as $key => $val) { $applist .= "{$val[no]},{$val[ver]}|"; } $applist = trim($applist, '|'); $post = array('ver' => $metcms_v, 'app' => $applist); $result = curl_post($post, 60); if (link_error($result) == 1) { $results = explode('<Met>', $result); file_put_contents('dlappfile.php', $results[1]); file_put_contents('standard.php', $results[0] . $results[1]); } if (file_exists('standard.php')) { filescan('../../..', 'standard.php'); } else { $physical_file = "0"; } } $physical_file = $physical_file == null ? "-1" : $physical_file; require_once $depth . '../include/config.php'; header("location:index.php?lang={$lang}&anyid={$anyid}&phy=1"); exit; } elseif ($action == "fingerprint") {
function syn_lang($post, $filename, $langmark, $site, $type) { global $met_host, $met_file, $met_language, $db; $met_file = '/dl/lang/lang.php'; $restr = curl_post($post, 30); $link = link_error($restr); if ($link != 1) { return $link; } filetest($filename); file_put_contents($filename, $restr); $array = 0; $no_order = 0; $array_l = 0; $no_order_l = 0; $array_s = 0; $no_order_s = 0; if (file_exists($filename)) { if ($type != 1) { $query = "delete from {$met_language} where site='{$site}' and app='0' and lang='{$langmark}'"; $db->query($query); } $fp = @fopen($filename, "r"); while ($conf_line = @fgets($fp, 1024)) { if (substr($conf_line, 0, 1) == "#") { $no_order_l++; $array_l = 0; $no_order_s = 0; $array = $array_l; $no_order = $no_order_l; $line = ereg_replace("^#", "", $conf_line); $flag = 1; } else { $no_order_s++; $array_s = $no_order_l; $line = $conf_line; $array = $array_s; $no_order = $no_order_s; $flag = 0; } if (trim($line) == "") { continue; } $linearray = explode('=', $line); $linenum = count($linearray); if ($linenum == 2) { list($name, $value) = explode('=', $line); } else { for ($i = 0; $i < $linenum; $i++) { $linetra = $i ? $linetra . "=" . $linearray[$i] : $linearray[$i] . 'metinfo_'; } list($name, $value) = explode('metinfo_=', $linetra); } $value = str_replace("\"", """, $value); list($value, $valueinfo) = explode('/*', $value); $name = str_replace('\\', '', daddslashes(trim($name), 1, 'metinfo')); $value = str_replace("'", "''", $value); $value = str_replace("\\", "\\\\", $value); $value = trim($value, "\n"); $value = trim($value, "\r"); $value = trim($value, "\n"); $value = trim($value, "\r"); $value = str_replace('\\n', ',', $value); $query = "insert into {$met_language} set name='{$name}',value='{$value}',site='{$site}',no_order='{$no_order}',array='{$array}',lang='{$langmark}'"; $db->query($query); } fclose($fp); } unlink($filename); return 1; }