TP_个人修改核心文件部分_持续更新
(1)关联模型更新/删除,condition与pk互斥问题
ThinkPHP\Library\Think\Model\RelationModel.class.php 273行
源代码:if(!empty($val['condition'])) {<br>
$mappingCondition = $val['condition'];<br>
}else{<br>
$mappingCondition = array();<br>
$mappingCondition[$mappingFk] = $pk;<br>
}
修改为:$mappingCondition = array();<br>
if(!empty($val['condition'])) {<br>
$mappingCondition['_string'] = $val['condition'];<br>
}<br>
$mappingCondition[$mappingFk] = $pk;
(2)标签库taglib,autoBuildVar统一格式
ThinkPHP\Library\Think\Template\Taglib.class.php 161行
源代码:if(0===strpos($val,'$')) {<br>
$name .= '["{'.$val.'}"]';<br>
}else{<br>
$name .= '["'.$val.'"]';<br>
}
修改为if(0===strpos($val,'$')) {<br>
$name .= '[\'{'.$val.'}\']';<br>
}else{<br>
$name .= '[\''.$val.'\']';<br>
}
(3)修正设置SESSION前缀情况下$Think.session.admin.info失效
ThinkPHP\Library\Think\Template.class.php 605行开始case 'COOKIE':<br>
if(isset($vars[3])) {<br>
$parseStr = '$_COOKIE[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>
}else{<br>
$parseStr = 'cookie(\''.$vars[2].'\')';<br>
}<br>
break;<br>
case 'SESSION':<br>
if(isset($vars[3])) {<br>
$parseStr = '$_SESSION[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>
}else{<br>
$parseStr = 'session(\''.$vars[2].'\')';<br>
}<br>
break;
修改为case 'COOKIE':<br>
if(isset($vars[3])) {<br>
$prefix=C('COOKIE_PREFIX');<br>
$prefixStr=empty($prefix) ? '' : "['".$prefix."']";<br>
$parseStr = '$_COOKIE'.$prefixStr.'[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>
}else{<br>
$parseStr = 'cookie(\''.$vars[2].'\')';<br>
}<br>
break;<br>
case 'SESSION':<br>
if(isset($vars[3])) {<br>
$prefix=C('SESSION_PREFIX');<br>
$prefixStr=empty($prefix) ? '' : "['".$prefix."']";<br>
$parseStr = '$_SESSION'.$prefixStr.'[\''.$vars[2].'\'][\''.$vars[3].'\']';<br>
}else{<br>
$parseStr = 'session(\''.$vars[2].'\')';<br>
}<br>
break;
AD:真正免费,域名+虚机+企业邮箱=0元