Autoescape + raw modifier in a tag that does not print, followed by a printed variable

Open Beginner friendly
#1,215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
63/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend

Research direction

The issue provides a regression test using eval:{$bar = $foo|raw}{$foo} and expects the second output to remain autoescaped. Start by locating the existing autoescape and raw modifier tests in the repository, then trace how assignment tags affect the next printed variable. Done means the regression test passes and the following output is still escaped.

Written by the indexing model from the issue text.

Description

public function testAutoEscapeRawInAssignDoesNotAffectNextOutput() {
        $tpl = $this->smarty->createTemplate('eval:{$bar = $foo|raw}{$foo}');
        $tpl->assign('foo', '<[email protected]>');
        $this->assertEquals("&lt;[email protected]&gt;", $this->smarty->fetch($tpl));
    }
Dominant language
PHP
Stars
2.3k
Forks
705
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from smarty-php/smarty

All issues in smarty-php/smarty

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.