allow php tag,Smarty allow_php_tag报告'未定义的属性:Smarty :: $ allow_php_tag'
所以我有一个使用老版本smarty的旧网站,因为今天我想升级到最新版本,而且它碰到了我一个错误:
[Fri Aug 19 11:21:19 2011] [error] [client ***.***.***.***] PHP Notice: Undefined property: Smarty::$allow_php_tag in /work/smarty3.1rc1/Smarty.class.php on line 592
[Fri Aug 19 11:21:19 2011] [error] [client ***.***.***.***] PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/work/templates/modules/main_module.tpl" on line 2 "{php}" unknown tag "php"' in /work/smarty3.1rc1/sysplugins/smarty_internal_templatecompilerbase.php:596
Stack trace:
#0 /work/smarty3.1rc1/sysplugins/smarty_internal_templatecompilerbase.php(382): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "ph...', 2)
#1 /work/smarty3.1rc1/sysplugins/smarty_internal_templateparser.php(2383): Smarty_Internal_TemplateCompilerBase->compileTag('php', Array)
#2 /work/smarty3.1rc1/sysplugins/smarty_internal_templateparser.php(2865): Smarty_Internal_Templateparser->yy_r38()
#3 /work/smarty3.1rc1/sysplugins/smarty_internal_templateparser.php(2965): Smarty_Internal_Templateparser->yy_reduce(38)
#4 in /work/smarty3.1rc1/sysplugins/smarty_internal_templatecompilerbase.php on line 596即使我把Smarty 3.0.8放到了同一个错误中......
由于该网站如果填写了{php}标签,因此无法删除。
我能做什么?
好的,下面@ Pekka的指示我发现了Smarty Security
下一个问题:
$my_security_policy = new Smarty_Security($smarty);
$my_security_policy->allow_php_tag = true;
$my_security_policy->php_functions = array();
$my_security_policy->php_handling = Smarty::PHP_PASSTHRU;
$my_security_policy->php_modifier = array();
$my_security_policy->modifiers = array();
$smarty->enableSecurity($my_security_policy);呼喊:
[Fri Aug 19 12:06:40 2011] [error] [client ***.***.***.***] PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template .....' modifier 'strtolower' not allowed by security setting'现在有什么错... $my_security_policy->php_functions = array();允许所有的php函数..
allow php tag,Smarty allow_php_tag报告'未定义的属性:Smarty :: $ allow_php_tag'相关推荐
- php类中使用未定义的属性说明
一般情况下,在类中要使用一个属性,最好是先申明这个属性.否则就是给自己的挖坑了. 先来看以下一段代码, <?php class test_class{public function out(){ ...
- 使用proxy来调用未定义的属性方法
当我们调用一个函数的未定义属性时会报错.那么可以使用一个proxy拦截,并且传入dispatch函数,来使当调用未定义属性时,执行dispatch函数. 原理: 创建一个实例:function cre ...
- php属性未定义,PHP-警告-未定义的属性:stdClass-修复?
我在错误日志中收到此警告,并想知道如何在代码中更正此问题. 警告:PHP注意:未定义属性:stdClass :: $ records在440行的script.php中 一些代码: // Parse o ...
- datatype未定义是什么意思_TypeError:无法读取未定义的属性'then'
loginService.islogged() 上面的函数返回一个像"失败"的字符串 . 但是,当我尝试运行然后对它运行时,它将返回错误 TypeError: Cannot rea ...
- html文件中未定义属性名错误,错误:无法读取未定义的属性已检查
我正在尝试将已选中复选框的结果存储在本地存储中,但是当我尝试保存时,我得到上面提到的错误. 不太确定什么是未定义的,因为我在代码中看到了属性.这是代码: var getCheckboxValue = ...
- java定义属性错误_错误TypeError:无法读取未定义的属性'firstName'
我是Angular的新手,所以请耐心等待 . 我想从firebase firestore获取当前登录用户的firstName,并在仪表板页面上显示它 . 但是当我尝试加载仪表板时,出现以下错误: Ad ...
- ajax beforesend xhr对象,beforeSend XHR对象:遗漏的类型错误:无法读取的未定义的属性“的addEventList...
我不断收到此错误: 遗漏的类型错误:无法读取属性"的addEventListener"的不确定在哪里我想申请一个"进步"事件监听器 为什么会出现这个错误? $( ...
- execjs执行js出现window对象未定义时的解决_10个常见的JS语言错误总汇
1. Uncaught TypeError: Cannot Read Property 这是 JavaScript 开发人员最常遇到的错误.当你读取一个属性或调用一个未定义对象的方法时,Chrome ...
- 检测未定义的对象属性
检查JavaScript中的对象属性是否未定义的最佳方法是什么? #1楼 我没有看到(希望我没有错过它)有人在属性之前检查对象. 因此,这是最短和最有效的(尽管不一定最清晰): if (obj &am ...
最新文章
- echart横轴文字显示省略号_echarts X轴显示不全 有省略
- 关卡设计快速入门_7. 自己来!
- c++ 数据类型转换笔记
- 【转】Spring Boot快速入门
- 数据流和十六进制转换
- ai圆角插件_【干货满满】AI软件技巧排版所需
- EntityFramework Code First 添加唯一键
- flask standrad class 使用
- win10鼠标灵敏度怎么调_和平精英灵敏度怎么设置才最合适 调最适合自己用的
- (16)Verilog HDL常量:数值表示
- [渝粤教育] 中国地质大学 职业健康管理体系 复习题
- liunx apache 的安装
- 非线性光纤光学——四波混频
- Rsyslog Properties and the Property Replacer
- Smbus host controller not enabled Assuming drive cache : write through
- 对比俩个List之间的差异
- 解决error ‘XXX‘ is not defined no-undef且项目没有eslintrc.js文件问题
- #NAME?_#NAME?:EXCEL表中出现#NAME是什么意思?
- Windows8内核模式下开发NDIS应用-NDIS Filter讲解
- PAT A1095 Cars on Campus ——一夜鱼龙舞
热门文章
- linux命令-eq是什么意思,linux查看系统信息命令
- encoder decoder模型_3分钟|聊一聊 Decoder 模块
- 神经网络 误差下降 准确率不上升_Go进程的HeapReleased上升,但是RSS不下降造成内存泄漏?...
- android逆透视变换坐标,android – 如何使用OpenGL模拟OpenCV的warpPerspective功能(透视变换)...
- js 去重某个键值 数组对象_JS数组去重常见方法分析
- 1加6投屏_6月的早餐,1杯牛奶加燕麦,营养健康又美味,饱腹感很强
- html 获取本地txt输出,html 5 读取本地文件API
- ps图片如何实现渐变
- SpringBoot 注解 @Configuration @PropertySource @Value
- Java 蓝桥杯 芯片测试