smarty-php / smarty-php/smarty

Escape Html - turn on / set a true by default

Open
#863 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement major
Dominant language
PHP
Stars
2.3k
Forks
709
PR merge metrics
No merged PRs in 30d

Description

Hi,

Since you release new version (v4) and in future versions, make no sense nowadays the option $smarty->escape_html not be set a true or with $smarty->default_modifiers not without a this option: ['escape:"htmlall"'] .

Because without at least one of the options activated the library is not avoiding XSS attacks.
And since you have a section for designers, since people without php knowledge, will forget escape modifier.

Finally, since smarty is a compiler template engine, i think should have the same behavior of others compiled template engine like this standalone template: Twig and Latte .
Or like Blade template ( with laravel) .

Thank you.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reviewing Smarty's escape_html and default_modifiers options and the reported behavior in version 4. Compare the proposed defaults with the Twig, Latte, and Blade behavior mentioned in the issue; done should mean the template engine provides safer escaping by default without leaving the intended configuration unclear.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.