更改加密方式
parent
8e6dd829f0
commit
6b65bf579d
|
@ -24,7 +24,7 @@ if (empty($_REQUEST)) {
|
||||||
// 解密删除
|
// 解密删除
|
||||||
if (isset($_GET['hash'])) {
|
if (isset($_GET['hash'])) {
|
||||||
$delFile = $_GET['hash'];
|
$delFile = $_GET['hash'];
|
||||||
$delFile = ulrHash($delFile, 1);
|
$delFile = urlHash($delFile, 1);
|
||||||
getDel($delFile);
|
getDel($delFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ if ($handle->uploaded) {
|
||||||
|
|
||||||
// 上传成功后返回json数据
|
// 上传成功后返回json数据
|
||||||
$imageUrl = $config['domain'] . config_path() . $handle->file_dst_name;
|
$imageUrl = $config['domain'] . config_path() . $handle->file_dst_name;
|
||||||
$delUrl = $config['domain'] . '/api/del.php?hash=' . ulrHash(config_path() . $handle->file_dst_name, 0);
|
$delUrl = $config['domain'] . '/api/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
||||||
|
|
||||||
$reJson = array(
|
$reJson = array(
|
||||||
"result" => 'success',
|
"result" => 'success',
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @author icret
|
* @author icret
|
||||||
* @email lemonim@qq.com
|
* @email lemonim@qq.com
|
||||||
* @Github https://github.com/icret/easyImages2.0
|
* @Github https://github.com/icret/easyImages2.0
|
||||||
* @Last 2021-5-4 18:08:08
|
* @Last 2021-5-5 04:33:16
|
||||||
|
|
||||||
* 上传后请打开check.php先检查服务器配置,更改密码等操作
|
* 上传后请打开check.php先检查服务器配置,更改密码等操作
|
||||||
* 安装完毕后请删除README.md,check.php,LICENSE等非必要文件
|
* 安装完毕后请删除README.md,check.php,LICENSE等非必要文件
|
||||||
|
@ -54,7 +54,7 @@ $config = array(
|
||||||
// 每次最多上传图片数
|
// 每次最多上传图片数
|
||||||
'maxUploadFiles' => 30,
|
'maxUploadFiles' => 30,
|
||||||
// 是否开启登录上传 开启:true 关闭:false
|
// 是否开启登录上传 开启:true 关闭:false
|
||||||
'mustLogin' => true,
|
'mustLogin' => false,
|
||||||
// 是否开启tinyfilemanager文件管理 开启:true 关闭:false
|
// 是否开启tinyfilemanager文件管理 开启:true 关闭:false
|
||||||
'tinyfilemanager' => true,
|
'tinyfilemanager' => true,
|
||||||
// 登录上传和后台管理密码,管理用户名为:admin
|
// 登录上传和后台管理密码,管理用户名为:admin
|
||||||
|
@ -112,7 +112,7 @@ $config = array(
|
||||||
'customize' => '
|
'customize' => '
|
||||||
<!--打赏
|
<!--打赏
|
||||||
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
<div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||||
<img data-toggle="lightbox" src="//i1.100024.xyz/i/2019/06/15/1u713g.png" data-image="//i1.100024.xyz/i/2019/06/15/1u713g.png" data-caption="赞助开发者" class="img-thumbnail" alt="" width="220">
|
<img data-toggle="lightbox" src="//i1.100024.xyz/public/images/dashang.png" data-image="//i1.100024.xyz/public/images/dashang.png" data-caption="赞助开发者" class="img-thumbnail" alt="" width="220">
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<!-- 非img.545141.com跳转
|
<!-- 非img.545141.com跳转
|
||||||
|
|
2
file.php
2
file.php
|
@ -77,7 +77,7 @@ if ($handle->uploaded) {
|
||||||
|
|
||||||
// 上传成功后返回json数据
|
// 上传成功后返回json数据
|
||||||
$imageUrl = $config['domain'] . config_path() . $handle->file_dst_name;
|
$imageUrl = $config['domain'] . config_path() . $handle->file_dst_name;
|
||||||
$delUrl = $_SERVER['HTTP_HOST'] . '/api/del.php?hash=' . ulrHash(config_path() . $handle->file_dst_name, 0);
|
$delUrl = $config['domain'] . '/api/del.php?hash=' . urlHash(config_path() . $handle->file_dst_name, 0);
|
||||||
|
|
||||||
$reJson = array(
|
$reJson = array(
|
||||||
"result" => 'success',
|
"result" => 'success',
|
||||||
|
|
|
@ -301,15 +301,16 @@ function getActive($url)
|
||||||
* @param int $mode =1或0 1解密 0加密
|
* @param int $mode =1或0 1解密 0加密
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function ulrHash($data, $mode)
|
function urlHash($data, $mode)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$key = $config['password'];
|
$key = $config['password'];
|
||||||
|
$iv = 'sciCuBC7orQtDhTO';
|
||||||
if ($mode) {
|
if ($mode) {
|
||||||
$decode = openssl_decrypt(urldecode($data), "DES-ECB", $key, 0);
|
$decode = openssl_decrypt(base64_decode($data), "AES-128-CBC", $key, 0,$iv);
|
||||||
return $decode;
|
return $decode;
|
||||||
} else {
|
} else {
|
||||||
$encode = urlencode(openssl_encrypt($data, "DES-ECB", $key, 0));
|
$encode = base64_encode(openssl_encrypt($data, "AES-128-CBC", $key, 0,$iv));
|
||||||
return $encode;
|
return $encode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue