Skip to content

Commit

Permalink
Compatible with php8 / 兼容php8
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Jan 12, 2021
1 parent 7188fe4 commit 4f7c516
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function getMyList(){
$display_name = I("display_name");
$username = I("username");
$return = array() ;
$where = " uid = '{$login_user[uid]}' ";
$where = " uid = {$login_user['uid']} ";
if($attachment_type == 1 ){
$where .=" and file_type like '%image%' " ;
}
Expand Down
2 changes: 1 addition & 1 deletion server/Application/Api/Model/CaptchaModel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
class CaptchaModel extends BaseModel {

public function check($captcha_id , $captcha){
public function check($captcha_id , $captcha, $none =''){
$time = time() ;
$captcha_array = $this->where(" captcha_id = '$captcha_id' and expire_time > $time ")->find();
if ($captcha_array['captcha'] && $captcha_array['captcha'] == $captcha) {
Expand Down
2 changes: 1 addition & 1 deletion server/Application/Api/Model/ItemTokenModel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function setLastTime($item_id){
}

//检查token。如果检测通过则返回item_id
public function check($api_key , $api_token){
public function check($api_key , $api_token, $no = ''){
$ret = $this->getTokenByKey($api_key);
if ($ret && $ret['api_token'] == $api_token) {
$item_id = $ret['item_id'] ;
Expand Down
3 changes: 2 additions & 1 deletion server/Application/Home/Controller/ItemController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function add(){
}

//根据项目类型展示项目
public function show(){
//这些参数都不需要用到,只是为了兼容父类的方法。php8需要compatible with父类的同名方法
public function show($content='', $charset = '', $contentType = '', $prefix = ''){
$this->checkLogin(false);
$item_id = I("item_id/d");
$item_domain = I("item_domain/s");
Expand Down
3 changes: 1 addition & 2 deletions server/ThinkPHP/Common/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ function I($name,$default='',$filter=null,$datas=null) {
}else{ // 变量默认值
$data = isset($default)?$default:null;
}
is_array($data) && array_walk_recursive($data,'
');
is_array($data) && array_walk_recursive($data,'think_filter');
return $data;
}
Expand Down
2 changes: 1 addition & 1 deletion server/ThinkPHP/Library/Think/Template.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public function parseThinkVar($varStr){
* @param array $vars 要传递的变量列表
* @return string
*/
private function parseIncludeItem($tmplPublicName,$vars=array(),$extend){
private function parseIncludeItem($tmplPublicName,$vars=array(),$extend = true ){
// 分析模板文件名并读取内容
$parseStr = $this->parseTemplateName($tmplPublicName);
// 替换变量
Expand Down
6 changes: 5 additions & 1 deletion server/ThinkPHP/Library/Think/Upload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ public function upload($files='') {
}

/* 调用回调函数检测文件是否存在 */
$data = call_user_func($this->callback, $file);
if($this->callback){
$data = call_user_func($this->callback, $file);
}else{
$data = false;
}
if( $this->callback && $data ){
if ( file_exists('.'.$data['path']) ) {
$info[$key] = $data;
Expand Down

0 comments on commit 4f7c516

Please sign in to comment.