Home >php教程 >php手册 >修复设置SESSION前缀情况下模板中$Think.session失效

修复设置SESSION前缀情况下模板中$Think.session失效

WBOY
WBOYOriginal
2016-06-07 11:38:161445browse

修复设置SESSION前缀情况下模板中$Think.session失效
设置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元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:仿蜻蜓FM源码Next article:分享php程序执行进度