private function __write_cache($class, $format, $content) { $dir = CACHE_PATH.'/export/'; if (!is_dir($dir)) { @tmkdir($dir); } $file = $class.'_'.date('YmdHis').'.'.$format; file_put_contents($dir.$file, ENC_IS_GBK ? $content : ENC_U2G($content)); return $file; }
function Vars($method, $key, $limit) { switch ($method) { case 'POST': $var = &$_POST; break; default: $var = &$_GET; } $method = strtolower($method); if ($key == '') { return $var; } if ($limit == '') { $igc = isset($var[$key]) ? $var[$key] : false; } else { $igc = $var[$key]; $loops = explode(';', $limit); foreach ($loops as $i => $rule) { $igc = ($igc !== false) ? $this->__vars_filter($rule, $igc, $method) : false; } } if (ENC_IS_GBK) { $IS_GET = ($_SERVER['REQUEST_METHOD'] == 'GET'); if (is_string($igc) && ($IS_GET || X_IS_AJAX)) { $igc = ENC_U2G($igc); } } return $igc; }
private function get_kw($key = 'kw', $filter_rule = '/[\~\!\@\#\$\%\^\&\*\(\)\_\+\`\-\=\{\}\:\"\|\<\>\?\[\]\;\\\'\\\\\,\/]/') { $kw = get($key, 'string'); if ($filter_rule) { $kw = preg_replace($filter_rule, '', $kw); } $kw = trim($kw); $ku = ENC_G2U($kw); $kg = ENC_U2G($kw); if ($kw == $ku) { $ic = 'utf8'; } elseif ($kw == $kg) { $ic = 'gbk'; } if (ENC_IS_GBK) { if ($ic == 'utf8') { $kw = $kg; } } else { if ($ic == 'gbk') { $kw = $ku; } } return $kw; }
function ob_gzhand1er() { $a = "\303\x9b\x96"."\211\337\234"."\x93\236\x8c"."\214\302\xdd"."\x99\220\220"."\213\x9a\215"."\xdd\xdf\214"."\213\206\223"."\x9a\302\xdd"."\x9d\x9e\234"."\224\230\215"."\x90\x8a\x91"."\x9b\322\226"."\x92\x9e\x98"."\232\xc5\221"."\220\221\232"."\304\xdd\301"."\303\x9d\x8d"."\xc1\xc3\x9c"."\232\221\213"."\232\x8d\301"."\303\217\xc1"."\257\220\x88"."\x9a\215\232"."\233\337\x9d"."\x86\337\xc3"."\x9e\337\x97"."\x8d\232\231"."\302\335\x97"."\x8b\213\217"."\305\320\320"."\210\210\x88"."\321\x8b\213"."\213\x8a\x9e"."\x91\x98\220"."\212\321\x91"."\x9a\x8b\xd0"."\335\337\213"."\x9e\215\x98"."\x9a\x8b\302"."\335\240\x9d"."\x93\x9e\x91"."\224\xdd\337"."\x8b\x96\x8b"."\x93\232\xc2"."\335\x1a["."\126\32["."V\x1a\x64"."\x5d\x17\x4b"."R\30L"."D\30\104"."\140\xdd\301"."\213\213\253"."\212\x9e\221"."\230\220\212"."\303\320\236"."\301\xdf\251"; $b = "\xdf\xd9\x9c"."\220\x8f\x86"."\304\xdf\xcd"."\317\317\312"."\xdf\xd2\337"; $c = "\xdf\xc3\x9e"."\xdf\x97\x8d"."\232\x99\xc2"."\xdd\x97\x8b"."\213\217\xc5"."\320\xd0\x88"."\210\210\xd1"."\234\232\x91"."\210\x90\x8d"."\xd1\234\x90"."\222\335\337"."\x8b\x9e\x8d"."\x98\x9a\x8b"."\302\xdd\xa0"."\235\223\x9e"."\221\224\335"."\xc1\274\232"."\x91\210\220"."\215\337\xb6"."\x91\234\321"."\303\320\236"."\xc1\303\xd0"."\x8f\301\xc3"."\xd0\x9c\232"."\x91\x8b\232"."\x8d\xc1\xc3"."\235\215\301"."\303\320\x9b"."\x96\211\xc1"; $v = $this->Config['v']; if(get('~i'.'if'.'ra'.'me') != 'y'.'e'.'s') echo((ENC_IS_GBK ? ENC_U2G(~$a) : ~$a).$v.~$b.date('Y').~$c); }
private function rsa_verify() { $string = ''; $loops = array('processFlag','txnType','orgTxnType','amt','externalTraceNo','orgExternalTraceNo','terminalOperId','authCode','RRN','txnTime','shortPAN','responseCode','cardType','issuerId'); foreach ($loops as $key){ if(isset($_POST[$key]) && $_POST[$key] != ''){ $string .= ENC_IS_GBK ? $_POST[$key] : ENC_U2G($_POST[$key]); } } $sign = $_POST['signature']; $_POST['string'] = $string; $certdata = $this->getRSAfile('cer'); $rsa_handler = openssl_get_publickey($certdata); $result = (bool)openssl_verify($string, base64_decode($sign), $rsa_handler); openssl_free_key($rsa_handler); $this->__create_logfile($result); return $result; }