Browse Source

Compatible with php8 / 兼容php8

star7th 4 years ago
parent
commit
4f7c5168dc

+ 1 - 1
server/Application/Api/Controller/AttachmentController.class.php

@@ -256,7 +256,7 @@ class AttachmentController extends BaseController {
         $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%' " ;
         }

+ 1 - 1
server/Application/Api/Model/CaptchaModel.class.php

@@ -7,7 +7,7 @@ use Api\Model\BaseModel;
  */
 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) {

+ 1 - 1
server/Application/Api/Model/ItemTokenModel.class.php

@@ -40,7 +40,7 @@ class ItemTokenModel extends BaseModel {
 	}
 
 	//检查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'] ;

+ 2 - 1
server/Application/Home/Controller/ItemController.class.php

@@ -47,7 +47,8 @@ class ItemController extends BaseController {
     }
 
     //根据项目类型展示项目
-    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");

+ 1 - 2
server/ThinkPHP/Common/functions.php

@@ -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;
 }
 

+ 1 - 1
server/ThinkPHP/Library/Think/Template.class.php

@@ -663,7 +663,7 @@ class  Template {
      * @param array $vars  要传递的变量列表
      * @return string
      */
-    private function parseIncludeItem($tmplPublicName,$vars=array(),$extend){
+    private function parseIncludeItem($tmplPublicName,$vars=array(),$extend = true ){
         // 分析模板文件名并读取内容
         $parseStr = $this->parseTemplateName($tmplPublicName);
         // 替换变量

+ 5 - 1
server/ThinkPHP/Library/Think/Upload.class.php

@@ -167,7 +167,11 @@ class Upload {
             }
 
             /* 调用回调函数检测文件是否存在 */
-            $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;