Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
修复 Referer 导致的 Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lc6464 committed Aug 17, 2020
1 parent 0b1b708 commit f7d5714
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ define('Password', '请在这里填写密码啦!ヾ(≧▽≦*)o');
- [PNL 下载方式](https://www.lanzous.com/u/pnl "PNL 下载方式")

## New Changes
- 当前版本:`1.3.4`
- 当前版本:`1.3.5`
- 更新日期:2020-8-17
- 以下修改由 [LC](https://github.com/lc6464 "LC") 完成
- 优化后端逻辑和效率
- 优化代码
- 优化错误时提示
- 修复 PHP 7- 版本使用时报错的情况
- 强制要求使用 PHP 7 或 7+
- 修复浏览器中点击下载链接,传递 Referer 导致概率性出错的问题

## 坑或不确定
- `static/functions.js`
Expand Down
4 changes: 2 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 请不要使用弱密码!否则后果自负!
* 若只在局域网开放,则可根据个人喜好开启或关闭密码。
*
* @version 1.3.4
* @version 1.3.5
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand All @@ -22,7 +22,7 @@
* @link https://lcwebsite.cn/
* @link https://space.bilibili.com/52618445
*/
define('programVersion', '1.3.4');
define('programVersion', '1.3.5');
if (!defined('init')){ // 直接访问处理程序
http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./');
die("HTTP 403 禁止访问!\r\n此文件是 PanDownload 网页复刻版 PHP 语言版项目版本 " . programVersion . " 的配置文件!\r\n禁止直接访问!");
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* 请勿随意修改此文件!如需更改相关配置请到 config.php !
*
* @version 1.3.4
* @version 1.3.5
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php
*
* @version 1.3.4
* @version 1.3.5
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand Down Expand Up @@ -205,8 +205,8 @@
<h5 class="alert-heading">获取下载链接失败</h5><hr /><p class="card-text">已获取到文件,但未能获取到下载链接!</p><p class="card-text">请检查你是否在 <code>config.php</code> 中配置 SVIP 账号的 BDUSS 和 STOKEN!</p>
<p class="card-text">未配置或配置了普通账号的均会导致失败!必须要 SVIP 账号!</p>' . FileInfo($filename, $size, $md5, $server_ctime) . '</div></div></div>'; // 未配置 SVIP 账号
else echo '<div class="row justify-content-center"><div class="col-md-7 col-sm-8 col-11"><div class="alert alert-primary" role="alert">
<h5 class="alert-heading">获取下载链接成功</h5><hr />' . FileInfo($filename, $size, $md5, $server_ctime) . '<p class="card-text"><a href="http://' . $realLink . '" target="_blank">下载链接(不安全)</a>
<a href="https://' . $realLink . '" target="_blank">下载链接(安全)</a></p><p class="card-text"><a href="?help" target="_blank">下载链接使用方法(必读)</a></p></div></div></div>'; // 成功!
<h5 class="alert-heading">获取下载链接成功</h5><hr />' . FileInfo($filename, $size, $md5, $server_ctime) . '<p class="card-text"><a href="http://' . $realLink . '" target="_blank" rel="nofollow noopener noreferrer">下载链接(不安全)</a>
<a href="https://' . $realLink . '" target="_blank" rel="nofollow noopener noreferrer">下载链接(安全)</a></p><p class="card-text"><a href="?help" target="_blank">下载链接使用方法(必读)</a></p></div></div></div>'; // 成功!
} else echo '<div class="row justify-content-center"><div class="col-md-7 col-sm-8 col-11"><div class="alert alert-danger" role="alert">
<h5 class="alert-heading">获取下载链接失败</h5><hr /><p class="card-text">未知错误!</p></div></div></div>'; // 未知错误
} else echo '<div class="row justify-content-center"><div class="col-md-7 col-sm-8 col-11"><div class="alert alert-danger" role="alert">
Expand Down

0 comments on commit f7d5714

Please sign in to comment.