落伍者(七窍玲珑)
世上无难事 只怕有心人
- 贡献
- 1014
- 鲜花
- 265
- 注册时间
- 2014-4-17
|
500积分
本帖最后由 mitu 于 2016-11-7 12:57 编辑
wecenter 点管理进入后台的时候 弹出页面提示crypt.php有错误代码
弹出地址是:域名/?/admin/
提示:
PHP Warning: mdecrypt_generic(): An empty string was passed inD:\freehost\yiguxi\web\fangshanzhai\system\core\crypt.php on line 58
PHP Warning: gzuncompress(): data error in D:\freehost\yiguxi\web\fangshanzhai\system\core\crypt.php on line 63
新安装的wecenter,其他页面正常,在官网发了,没人回答,MJJ帮忙看下怎么解决,谢谢!
crypt.php 代码:- <?php
- /*
- +--------------------------------------------------------------------------
- | WeCenter [#RELEASE_VERSION#]
- | ========================================
- | by WeCenter Software
- | © 2011 - 2014 WeCenter. All Rights Reserved
- | http://www.wecenter.com
- | ========================================
- | Support: WeCenter@qq.com
- |
- +---------------------------------------------------------------------------
- */
- class core_crypt
- {
- public function __construct()
- {
- if (!function_exists('mcrypt_module_open'))
- {
- exit('Error: Mcrypt Module not support');
- }
- }
- public function encode($data, $key = null)
- {
- $mcrypt = mcrypt_module_open($this->get_algorithms(), '', MCRYPT_MODE_ECB, '');
- mcrypt_generic_init($mcrypt, $this->get_key($mcrypt, $key), mcrypt_create_iv(mcrypt_enc_get_iv_size($mcrypt), MCRYPT_RAND));
- $result = mcrypt_generic($mcrypt, gzcompress($data));
- mcrypt_generic_deinit($mcrypt);
- mcrypt_module_close($mcrypt);
- return $this->get_algorithms() . '|' . $this->str_to_hex($result);
- }
- public function decode($data, $key = null)
- {
- if ($algorithm = strstr($data, '|', true))
- {
- $data = str_replace($algorithm . '|', '', $data);
- $data = $this->hex_to_str($data);
- }
- else
- {
- $algorithm = $this->get_algorithms();
- $data = base64_decode($data);
- }
- $mcrypt = mcrypt_module_open($algorithm, '', MCRYPT_MODE_ECB, '');
- mcrypt_generic_init($mcrypt, $this->get_key($mcrypt, $key), mcrypt_create_iv(mcrypt_enc_get_iv_size($mcrypt), MCRYPT_RAND));
- $result = trim(mdecrypt_generic($mcrypt, $data));
- mcrypt_generic_deinit($mcrypt);
- mcrypt_module_close($mcrypt);
- return gzuncompress($result);
- }
- private function get_key($mcrypt, $key = null)
- {
- if (!$key)
- {
- $key = G_COOKIE_HASH_KEY;
- }
- return substr($key, 0, mcrypt_enc_get_key_size($mcrypt));
- }
- private function get_algorithms()
- {
- $algorithms = mcrypt_list_algorithms();
- foreach ($algorithms AS $algorithm)
- {
- if (strstr($algorithm, '-256'))
- {
- return $algorithm;
- }
- }
- foreach ($algorithms AS $algorithm)
- {
- if (strstr($algorithm, '-128'))
- {
- return $algorithm;
- }
- }
- return end($algorithms);
- }
- private function str_to_hex($string)
- {
- for ($i = 0; $i < strlen($string); $i++)
- {
- $ord = ord($string[$i]);
- $hexCode = dechex($ord);
- $hex .= substr('0' . $hexCode, -2);
- }
- return strtoupper($hex);
- }
- private function hex_to_str($hex)
- {
- for ($i = 0; $i < strlen($hex)-1; $i += 2)
- {
- $string .= chr(hexdec($hex[$i] . $hex[$i + 1]));
- }
- return $string;
- }
- }
复制代码
|
最佳答案
查看完整内容
PHP 5.3以上
然后打开这个地址
你的域名/?/admin/login/
就可以输入用户名 密码 登录了
|