foreach ($this->hidden as $key => $val) {
if (is_string($val)) {
if (strpos($val '.')) {
[$relation $name
= explode('.' $val);
$this->hidden[$relation
[
= $name;
else {
$this->hidden[$val
= true;
unset($this->hidden[$key
);
// 合并关联数据
$data = https://mparticle.uc.cn/api/array_merge($this->data $this->relation);
foreach ($data as $key => $val) {
if ($val instanceof Model || $val instanceof ModelCollection) {
// 关联模型对象
if (isset($this->visible[$key
) && is_array($this->visible[$key
)) {
$val->visible($this->visible[$key
);
elseif (isset($this->hidden[$key
) && is_array($this->hidden[$key
)) {
$val->hidden($this->hidden[$key
);
// 关联模型对象
if (!isset($this->hidden[$key
) || true !== $this->hidden[$key
) {
$item[$key
= $val->toArray();
elseif (isset($this->visible[$key
)) {
$item[$key
= $this->getAttr($key);
elseif (!isset($this->hidden[$key
) && !$hasVisible) {
$item[$key
= $this->getAttr($key);
跟进getAttr方法 , 漏洞方法是getValue , 但传入getValue方法中的$value是由getData方法得到的 。
public function getAttr(string $name)
{
try {
$relation = false;
$value = $this->getData($name);
catch (InvalidArgumentException $e) {
$relation = $this->isRelationAttr($name);
$value = null;
return $this->getValue($name $value $relation);
跟进getData方法 , $this->data可控 , $fieldName来自getRealFieldName方法 。
跟进getRealFieldName方法 , 默认直接返回传入的参数 。 所以$fieldName也可控 , 也就是传入getValue的$value参数可控 。
跟进getValue方法 , 在Thinkphp6.0.8触发的漏洞点在①处 , 但在Thinkphp6.0.12时已经对传入的$closure
- 小米|小米最强影像旗舰!小米12S系列海报泄密:徕卡标变白了
- 陨石|小行星“打水漂”闯入地球 形成世界最长陨石陨落带
- 个头大的车厘子比小樱桃营养价值更高,对吗 蚂蚁新村6月28日答案最新
- ssd|小屏旗舰跌至2699元,67W快充+5000万三摄,成荣耀70最大对手
- 最前线 | 腾讯游戏发布40余款产品与项目,《王者荣耀》发布全新规划
- “大家好,我是渣渣辉!”,最近刷爆朋友圈的港普大家来了解一下
- 最小4毫米!一种名叫“老佛爷”的蜘蛛来了,灭绝生物会出现吗?
- 显卡|3个不买RTX 3080的理由:没钱只能排最后
- 世界最干旱沙漠传来消息,长出18亿棵树,科学家:令人担忧
- 高通骁龙|夏天一到骁龙8Gen1没怎么玩就发热?Find X5 Pro用户最有发言权
