-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from helloxz/dev
0.9.34
- Loading branch information
Showing
23 changed files
with
582 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* name:API核心类 | ||
* update:2020/12 | ||
* update:2024/01 | ||
* author:xiaoz<[email protected]> | ||
* blog:xiaoz.me | ||
*/ | ||
|
@@ -339,6 +339,18 @@ public function imp_link($token,$filename,$fid,$property = 0){ | |
//过滤$filename | ||
$filename = str_replace('../','',$filename); | ||
$filename = str_replace('./','',$filename); | ||
// 获取文件名称的后缀 | ||
$suffix = explode('.',$filename); | ||
// 如果没有后缀,则不合法,通过数组长度判断后缀 | ||
if( count($suffix) < 2 ) { | ||
$this->err_msg(-2000,'文件不合法!'); | ||
} | ||
// 获取文件后缀 | ||
$suffix = strtolower(end($suffix)); | ||
if( ( $suffix != 'html' ) && ( $suffix != 'htm' ) ) { | ||
$this->err_msg(-2000,'文件不合法!'); | ||
} | ||
|
||
$this->auth($token); | ||
//检查文件是否存在 | ||
if ( !file_exists($filename) ) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.