TP5框架低版本漏洞

2021-09-23 14:02:19 字數 1387 閱讀 1697

漏洞1:
// 設定預設過濾機制

$request

->

filter

($config

['default_filter'])

;// 當前模組路徑

:$modulepath=.

($module

?$module.ds

:'');

// 是否自動轉換控制器和操作名

$convert

=is_bool

($convert)?

$convert

:$config

['url_convert'];

// 獲取控制器名

$controller

=strip_tags

($result[1

]?:$config

['default_controller'])

;/**補丁** start**/if(

!preg_match

('/^[a-za-z](\w|\.)*$/'

,$controller))

/**補丁** end**/

$controller

=$convert

?strtolower

($controller):

$controller

;// 獲取操作名

$actionname

=strip_tags

($result[2

]?:$config

['default_action'])

;if(!

empty

($config

['action_convert'])

)else

漏洞2:
public

function

method

($method

=false

)elseif(!

$this

->

method)(

$_post);

}else

/**補丁** end**/

tp5框架原理詳解 TP5框架安全機制例項分析

防止sql注入 1 查詢條件盡量使用陣列方式,具體如下 wheres array wheres account account wheres password password user where wheres find 2 如果必須使用字串,建議使用預處理機制,具體如下 user d useri...

TP5 框架 實現無限級分類

首先我們在模型中的 use think model class cate extends model 建立方法 data引數是資料庫所有資料 pid引數是資料庫pid le引數是為了區分顯示級別的 public function sort data,pid 0,level 0 將最後的內容輸出返回 ...

tp5使用框架自帶搜尋加分頁

檢視層 搜尋框主體部分 訂單匯入 手動新增 未上架已上架 編輯 vo.g id 刪除 檢視層head裡加上分頁樣式 模型層裡 列表分頁搜尋 public function getpagedata s,where,pagesize 控制器 商品列表 public function goodslist ...