- bugfix 'self::' and 'parent::' was interpreted in template syntax as static class

This commit is contained in:
Uwe Tews
2015-01-21 23:30:37 +01:00
parent 8d5fa36a80
commit ec19bc763f
3 changed files with 4 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
21.01.2015
- bugfix clearCompiledTemplates(), clearAll() and clear() could try to delete whole drive at wrong path permissions because realpath() fail (forum 25397)
- bugfix 'self::' and 'parent::' was interpreted in template syntax as static class
04.01.2015
- push last weeks changes to github

View File

@@ -924,7 +924,7 @@ value(res) ::= NAMESPACE(c). {
// static class access
value(res) ::= ns1(c)DOUBLECOLON static_class_access(s). {
if (!$this->security || isset($this->smarty->registered_classes[c]) || $this->smarty->security_policy->isTrustedStaticClass(c, $this->compiler)) {
if (!in_array(strtolower(c), array('self', 'parent')) && (!$this->security || isset($this->smarty->registered_classes[c]) || $this->smarty->security_policy->isTrustedStaticClass(c, $this->compiler))) {
if (isset($this->smarty->registered_classes[c])) {
res = $this->smarty->registered_classes[c].'::'.s;
} else {

View File

@@ -1,5 +1,4 @@
<?php
class TP_yyToken implements ArrayAccess
{
public $string = '';
@@ -73,13 +72,13 @@ class TP_yyStackEntry
public $minor; /* The user-supplied minor token value. This
** is the value of the token */
}
;
#line 13 "../smarty/lexer/smarty_internal_templateparser.y"
/**
* Smarty Internal Plugin Templateparser
*
* This is the template parser.
* It is generated from the smarty_internal_templateparser.y file
*
@@ -2915,7 +2914,7 @@ class Smarty_Internal_Templateparser
#line 926 "../smarty/lexer/smarty_internal_templateparser.y"
function yy_r117()
{
if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + - 2]->minor, $this->compiler)) {
if (!in_array(strtolower($this->yystack[$this->yyidx + - 2]->minor), array('self', 'parent')) && (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + - 2]->minor, $this->compiler))) {
if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor])) {
$this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor] . '::' . $this->yystack[$this->yyidx + 0]->minor;
} else {