mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix 'self::' and 'parent::' was interpreted in template syntax as static class
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
21.01.2015
|
21.01.2015
|
||||||
- bugfix clearCompiledTemplates(), clearAll() and clear() could try to delete whole drive at wrong path permissions because realpath() fail (forum 25397)
|
- 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
|
04.01.2015
|
||||||
- push last weeks changes to github
|
- push last weeks changes to github
|
||||||
|
@@ -924,7 +924,7 @@ value(res) ::= NAMESPACE(c). {
|
|||||||
|
|
||||||
// static class access
|
// static class access
|
||||||
value(res) ::= ns1(c)DOUBLECOLON static_class_access(s). {
|
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])) {
|
if (isset($this->smarty->registered_classes[c])) {
|
||||||
res = $this->smarty->registered_classes[c].'::'.s;
|
res = $this->smarty->registered_classes[c].'::'.s;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class TP_yyToken implements ArrayAccess
|
class TP_yyToken implements ArrayAccess
|
||||||
{
|
{
|
||||||
public $string = '';
|
public $string = '';
|
||||||
@@ -73,13 +72,13 @@ class TP_yyStackEntry
|
|||||||
public $minor; /* The user-supplied minor token value. This
|
public $minor; /* The user-supplied minor token value. This
|
||||||
** is the value of the token */
|
** is the value of the token */
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
#line 13 "../smarty/lexer/smarty_internal_templateparser.y"
|
#line 13 "../smarty/lexer/smarty_internal_templateparser.y"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Templateparser
|
* Smarty Internal Plugin Templateparser
|
||||||
|
*
|
||||||
* This is the template parser.
|
* This is the template parser.
|
||||||
* It is generated from the smarty_internal_templateparser.y file
|
* 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"
|
#line 926 "../smarty/lexer/smarty_internal_templateparser.y"
|
||||||
function yy_r117()
|
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])) {
|
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;
|
$this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor] . '::' . $this->yystack[$this->yyidx + 0]->minor;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user