Skip to content

Commit

Permalink
- bugfix compiling super globals like {$smarty.get.foo} did fail in t…
Browse files Browse the repository at this point in the history
…he master branch #77
  • Loading branch information
uwetews committed Aug 23, 2015
1 parent 9fd0b30 commit 0e4039f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
- optimize use_include_path processing
- relocate properties for size optimization
- remove redundant code

- bugfix compiling super globals like {$smarty.get.foo} did fail in the master branch https://github.com/smarty-php/smarty/issues/77

06.08.2015
- avoid possible circular object references caused by parser/lexer objects
- rewrite compileAll... utility methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $
$compiler->trigger_template_error("(secure mode) super globals not permitted");
break;
}
return '$_' . strtoupper($variable);
$compiled_ref = '$_' . strtoupper($variable);
break;
break;

case 'template':
Expand Down Expand Up @@ -117,7 +118,13 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $
$compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid');
break;
}
if (isset($_index[1])) {
array_shift($_index);
foreach ($_index as $_ind) {
$compiled_ref = $compiled_ref . "[$_ind]";
}
}
return $compiled_ref;
}
return '';
}
}

2 comments on commit 0e4039f

@ophian
Copy link

@ophian ophian commented on 0e4039f Aug 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Uwe
There now is a double break; at line 71/72. Still remaining in master. Does that make sense?
@uwetews

@uwetews
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake

Please sign in to comment.