|
供参考:
中文 MD5加密:
新建函数两个:
function space_encode($code,$seed = "PhpDisk=NcTen", $safe = false){
if ($safe) $code = base64_encode(strrev(str_rot13($code)));
$c_l = strlen($code);
$s_m = md5($seed);
$s_l = strlen($m);
$a=0;
while ($a <$c_l){
$str .= sprintf ("%'02s",base_convert(ord($code{$a})+ord($s_m{$s_l % $a+1}),10,32));
$a++;
}
return $str;//wordwrap($str, 80, "\n", true)
}
function space_decode($code, $seed = 'PhpDisk=NcTen', $safe = false){
//$code = preg_replace("'[ \r\n\t]+'", '', $code);
preg_match_all("/.{2}/", $code, $arr);
$arr = $arr[0];
$s_m = md5($seed);
$s_l = strlen($m);
$a = 0;
foreach ($arr as $value){
$str .= chr(base_convert($value,32,10)-ord($s_m{$s_l % $a+1}));
$a++;
}
if ($safe) $str = str_rot13(strrev(base64_decode($str)));
return $str;
}
修改:
/plugins/seo/functions.inc.php
1、添加上面的两个函数
2、修改 return 'space-'.rawurlencode($username).'.html';
为: return 'space-'.space_encode($username,"PhpDisk=NcTen",true).'.html';
修改:
/space.php
$username = $db->escape(trim(gpc('username','G','')));
为:
$username = $db->escape(space_decode(trim(gpc('username','G','')),"PhpDisk=NcTen",true));
就OK啦
欢迎测试并使用 |
|