Commit Graph

3586 Commits

Author SHA1 Message Date
Fabien Potencier c0d5991cf7 feature #2893 Add TemplateWrapper::getTemplateName() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add TemplateWrapper::getTemplateName()

closes #2892

Commits
-------

861066e5 added TemplateWrapper::getTemplateName()
2019-03-12 19:40:48 +01:00
Fabien Potencier 861066e50b added TemplateWrapper::getTemplateName() 2019-03-12 19:33:04 +01:00
Fabien Potencier b0d8cd7788 bumped version to 1.38.2-DEV 2019-03-12 16:43:49 +01:00
Fabien Potencier 88fc6d1454 prepared the 1.38.1 release v1.38.1 2019-03-12 16:43:04 +01:00
Fabien Potencier 675686844a updated CHANGELOG 2019-03-12 16:41:40 +01:00
Fabien Potencier fb19ea7dde fixed CS 2019-03-12 16:38:19 +01:00
Fabien Potencier dd22fe6f84 bug #2887 Force loading class aliases used in typehints (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Force loading class aliases used in typehints

Fixes #2886

Commits
-------

65c05591 force loading class aliases used in typehints
2019-03-12 16:35:38 +01:00
Christophe Coevoet 65c0559125 force loading class aliases used in typehints 2019-03-12 15:24:00 +01:00
Fabien Potencier 47297c2ae9 bumped version to 1.38.1-DEV 2019-03-12 13:43:05 +01:00
Fabien Potencier 754b8dfc00 prepared the 1.38.0 release v1.38.0 2019-03-12 13:42:04 +01:00
Fabien Potencier 0f3af98ef6 security #2885 Fix security issue in the sandbox (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Fix security issue in the sandbox

Commits
-------

eac54229 fixed security issue in the sandbox
2019-03-12 13:35:01 +01:00
Fabien Potencier 5e1a3615bc removed one usage of Template vs TemplateWrapper 2019-03-12 11:16:55 +01:00
Fabien Potencier eac5422956 fixed security issue in the sandbox 2019-03-12 11:09:54 +01:00
Fabien Potencier 7e305693b0 bug #2884 Fix "batch filter clobbers array keys when fill parameter is used " (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2884).

Discussion
----------

Fix "batch filter clobbers array keys when fill parameter is used "

closes #2568

Commits
-------

750cb237 fixed batch filter clobbers array keys when fill parameter is used
ede9a604 added preserveKeys support for the batch filter
2019-03-12 11:05:45 +01:00
Fabien Potencier 750cb23742 fixed batch filter clobbers array keys when fill parameter is used 2019-03-12 10:57:52 +01:00
Fabien Potencier ede9a604eb added preserveKeys support for the batch filter 2019-03-12 10:56:31 +01:00
Fabien Potencier 4eeaf763a2 bug #2883 Fix "embed" support when used from "template_from_string" (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Fix "embed" support when used from "template_from_string"

closes #2761

Commits
-------

92a63e0c fixed "embed" support when used from "template_from_string"
2019-03-12 10:55:06 +01:00
Fabien Potencier 9f23f7c8e2 removed dead code 2019-03-12 10:36:40 +01:00
Fabien Potencier 92a63e0c77 fixed "embed" support when used from "template_from_string" 2019-03-12 09:28:36 +01:00
Fabien Potencier e7976359a9 fixed CS 2019-03-11 21:19:43 +01:00
Fabien Potencier bebc7a9d5b feature #2882 Environment class cleanup 1.x (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2882).

Discussion
----------

Environment class cleanup 1.x

Commits
-------

8ab10798 simplified code
e2103c87 use load() instead of loadTemplate() in tests
c82d7dca added the possibility to pass a TemplateWrapper to Twig\Environment::load()
2019-03-11 19:54:21 +01:00
Fabien Potencier 8ab1079842 simplified code 2019-03-11 19:19:06 +01:00
Fabien Potencier e2103c87ae use load() instead of loadTemplate() in tests 2019-03-11 19:18:00 +01:00
Fabien Potencier c82d7dcaab added the possibility to pass a TemplateWrapper to Twig\Environment::load() 2019-03-11 19:07:45 +01:00
Fabien Potencier eb89971925 minor #2879 Try to avoid guessing template info on errors (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2879).

Discussion
----------

Try to avoid guessing template info on errors

Right now, for syntax errors triggered in a Node, we guess the template line and source, but we then try to set the information in the Parser class. This PR avoids the guessing as it's slow.

Commits
-------

69c0539c removed -2 magic number
2389faea tried to avoid guessing template info on errors
2019-03-11 16:18:06 +01:00
Fabien Potencier 69c0539cc6 removed -2 magic number 2019-03-11 16:11:54 +01:00
Fabien Potencier 2389faeae3 tried to avoid guessing template info on errors 2019-03-11 16:04:11 +01:00
Fabien Potencier 04408cda3a tweaked docs for macro 2019-03-11 13:59:54 +01:00
Fabien Potencier 1da95371d1 minor #2870 document support for defining default argument values in the macro tag (olets)
This PR was merged into the 1.x branch.

Discussion
----------

document support for defining default argument values in the macro tag

The `macro` tag documentation reads

> Macros differ from native PHP functions in a few ways:
> - Default argument values are defined by using the default filter in the macro body

and provides the example

```twig
{% macro input(name, value, type, size) %}
    <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
{% endmacro %}
```

The implication is that native PHP function-like default argument value definition is not supported.

v1.12 added support for

```twig
{% macro input1(name, value, type = 'text', size = 20) %}
    <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}" />
{% endmacro %}
```

This updates the documentation to cover both ways of defining default argument values.

Commits
-------

40c7553a document support for defining default argument values in the macro tag
2019-03-11 13:55:14 +01:00
Fabien Potencier b1894d3df2 do not check sandbox for __toString if method does not exist on object 2019-03-11 12:03:25 +01:00
Fabien Potencier c36cf0db30 minor #2877 Tweak sandbox generated code (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Tweak sandbox generated code

Commits
-------

cbb8f6ed tweaked sandbox generated code
2019-03-11 11:49:33 +01:00
Fabien Potencier cbb8f6edc1 tweaked sandbox generated code 2019-03-11 08:53:51 +01:00
Fabien Potencier af6bdc4b12 fixed indentation of the compiled template 2019-03-11 07:48:38 +01:00
Fabien Potencier 7ce5261621 minor #2873 Improve the performance of the sandbox (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Improve the performance of the sandbox

Commits
-------

5c661869 improved the performance of the sandbox
2019-03-10 10:43:19 +01:00
Fabien Potencier 5c66186979 improved the performance of the sandbox 2019-03-10 10:34:31 +01:00
Fabien Potencier 68bbf5eb85 added a note about the performance of the spaceless filter 2019-03-10 08:59:57 +01:00
Henry Bley-Vroman 40c7553a69 document support for defining default argument values in the macro tag 2019-03-08 09:01:54 -05:00
Fabien Potencier 83efde6a4d Revert "re-implemented the spaceless tag to reuse the filter tag logic"
This reverts commit 743767bce8.
2019-03-07 10:58:47 +01:00
Fabien Potencier 9956811bbc feature #2872 Add spaceless filter (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2872).

Discussion
----------

Add spaceless filter

Commits
-------

a22a5c4b fixed CS
743767bc re-implemented the spaceless tag to reuse the filter tag logic
b823898e added a spaceless filter
1ba79416 removed unneeded usage of spaceless in tests
2019-03-07 10:24:21 +01:00
Fabien Potencier a22a5c4bd1 fixed CS 2019-03-07 10:20:57 +01:00
Fabien Potencier 743767bce8 re-implemented the spaceless tag to reuse the filter tag logic 2019-03-07 10:18:51 +01:00
Fabien Potencier b823898ee1 added a spaceless filter 2019-03-07 10:18:51 +01:00
Fabien Potencier 1ba7941656 removed unneeded usage of spaceless in tests 2019-03-07 08:03:42 +01:00
Fabien Potencier 5d79776175 bug #2871 Fix some issues (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Fix some issues

Commits
-------

c58fa840 fixed some issues
2019-03-06 22:09:17 +01:00
Fabien Potencier c58fa84054 fixed some issues 2019-03-06 22:08:00 +01:00
Fabien Potencier 586d5cb411 removed @internal tag on Twig\Template as the whole class is marked as internal 2019-03-06 18:43:55 +01:00
Fabien Potencier 19fd71eadd removed some unneded phpdocs 2019-03-06 18:22:06 +01:00
Fabien Potencier 9b8c3a2344 fixed more un-namespaced classes 2019-03-06 18:10:39 +01:00
Fabien Potencier f75d9891b2 fixed phpdocs 2019-03-06 15:57:47 +01:00
Fabien Potencier 690f53f98c minor #2869 Move some more PSR0 class names to namespaced ones (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Move some more PSR0 class names to namespaced ones

Commits
-------

4eb0c9da moved some more PSR0 class names to namespaced ones
2019-03-06 14:00:13 +01:00