12 Commits

Author SHA1 Message Date
Fabien Potencier 679447fa29 Encode single quotes as \x27 in Compiler::string()
This is a defense-in-depth measure: callers must always concatenate the
result into a double-quoted PHP context, but if one ever (mistakenly)
embeds it inside a single-quoted PHP literal, an attacker-controlled
single quote in the source value could break out of that context. The
previous commit fixed exactly such a bug in ModuleNode for the {% use %}
template name.

Encoding ' as the hex escape \x27 guarantees that the emitted PHP source
never contains a literal single quote derived from user input, while the
decoded runtime value is unchanged. \' is not used because it is not a
recognized escape sequence in PHP double-quoted strings (the backslash
would be kept literally).
2026-05-19 22:58:27 +02:00
Nicolas Grekas 85a4817128 CS fixes 2025-07-29 10:07:07 +02:00
Fabien Potencier e4e95f5b86 Replace template loader mocks by ArrayLoader 2024-07-24 08:27:23 +02:00
Fabien Potencier 2b2ac80d34 Fxi some errors reported by phpstan 2024-02-05 17:48:36 +01:00
Fabien Potencier 157fa56829 Merge branch '1.x' into 2.x
* 1.x:
  Fix CS
  Migrate to the new PHP CS Fixer config file
2021-05-12 09:27:30 +02:00
Fabien Potencier 59f3e8e5dc Fix CS 2021-05-12 09:19:37 +02:00
Fabien Potencier 656c295ed9 Merge branch '1.x' into 2.x
* 1.x:
  removed usage of getmockBuilder() when not needed
2019-08-08 13:33:07 +02:00
Fabien Potencier 5861a539e4 removed usage of getmockBuilder() when not needed 2019-08-08 11:59:51 +02:00
Fabien Potencier c829dafd75 Merge branch '1.x' into 2.x
* 1.x:
  Update to PhpUnitBridge and fix deprecations
2019-08-08 10:19:01 +02:00
Jérémy Derussé b776e41f5a Update to PhpUnitBridge and fix deprecations 2019-08-08 09:39:49 +02:00
Fabien Potencier 1e3bb75010 moved test under tests/ 2019-06-30 14:51:54 +02:00
Fabien Potencier 22a1317249 moved tests under tests/ 2019-06-30 14:48:27 +02:00