Skip to content

Commit

Permalink
Fixed render crash when using inline include with a string template. F…
Browse files Browse the repository at this point in the history
…ixed #639
  • Loading branch information
wisskid committed Mar 22, 2021
1 parent 4698dd9 commit 07de916
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- modifier escape now triggers a E_USER_NOTICE when an unsupported escape type is used https://github.com/smarty-php/smarty/pull/649

### Fixed
- Fixed render crash when using inline include with a string template https://github.com/smarty-php/smarty/issues/639

## [3.1.39] - 2021-02-17

### Security
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_internal_template.php
Expand Up @@ -317,7 +317,7 @@ public function _subTemplateRender(
$tpl->template_resource = $template;
$tpl->cache_id = $cache_id;
$tpl->compile_id = $compile_id;
if (isset($uid)) {
if (isset($uid) && isset($tpl->compiled->file_dependency[ $uid ])) {
// for inline templates we can get all resource information from file dependency
list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];
$tpl->source = new Smarty_Template_Source($smarty, $filepath, $type, $filepath);
Expand Down

0 comments on commit 07de916

Please sign in to comment.