Commit Graph

643 Commits

Author SHA1 Message Date
Fabien Potencier 55f8b27e12 added a way to add custom escaping strategies 2013-09-11 20:26:15 +02:00
Grégoire Pineau 8410f8caa9 Added Tests to prevent future regression 2013-09-02 14:28:12 +02:00
Fabien Potencier 440e399af5 merged branch Misiur/master (PR #1158)
This PR was squashed before being merged into the master branch (closes #1158).

Discussion
----------

Don't use array_fill for full array

When last array returned from array_chunk is full, array_fill is called with 0 as num argument, which causes fatal error. Additionally I've changed doc fill parameter, as other types are accepted as well, and added unit test.

Commits
-------

270c794 Don't use array_fill for full array
2013-08-06 07:44:33 +02:00
Marcin Misiurski 270c7943b1 Don't use array_fill for full array 2013-08-06 07:44:33 +02:00
Fabien Potencier 7b80c942e2 removed usage of deprecated constants 2013-08-05 18:25:53 +02:00
Fabien Potencier 696ef2daaa removed usage of deprecated classes in unit tests 2013-08-05 18:18:58 +02:00
Fabien Potencier f888818fd4 fixed two edge case bug in the filesystem loader
* fixed caching when two templates have the same template name but a different namespace
* fixed the error message when a template has a namespace
2013-08-05 18:00:05 +02:00
Fabien Potencier 7c1ce36f87 reverted optimizations done in the filesystem loader as it beaks BC 2013-08-05 10:15:36 +02:00
Fabien Potencier 9a01db60e8 replaced usage of md5/sha1 by sha256 2013-08-04 15:12:06 +02:00
Fabien Potencier 4e7094f6a3 merged branch fabpot/complex-template_from_string (PR #1154)
This PR was merged into the master branch.

Discussion
----------

fixed template_from_string when the template includes or extends other ones

This should fix #1134

Commits
-------

1b5bf91 fixed template_from_string when the template includes or extends other ones
2013-08-04 15:01:42 +02:00
Fabien Potencier 07b86d2852 merged branch tucksaun/fix-issue-1143 (PR #1147)
This PR was merged into the master branch.

Discussion
----------

Fix issue #1143

Commits
-------

5042159 [ext] access static properties, fixed #1143
dfc335f Added test case for issue #1143
2013-08-04 14:54:06 +02:00
Fabien Potencier 1b0a54189c fixed the filesystem loader cache when a template name exists in several namespaces 2013-08-04 08:43:33 +02:00
Fabien Potencier 3e4c6ab3dc fixed a bug in some unit tests (closes #1092) 2013-08-04 08:03:52 +02:00
Fabien Potencier 1b5bf91011 fixed template_from_string when the template includes or extends other ones 2013-08-03 19:28:34 +02:00
Fabien Potencier 120518d803 fixed some unit tests 2013-08-03 18:48:19 +02:00
Fabien Potencier 03926034c4 merged branch hason/macros (PR #1139)
This PR was merged into the master branch.

Discussion
----------

Improved macros

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #861, #867, #929, #1052
| License       | MIT
| Doc        | yes

* Fixed fatal error for unknown macro
* Added support for named arguments for macros
* Added support for directly call macros defined in the same template

Commits
-------

3004ba1 Added support for directly call macros defined in the same template
63615a6 Added support for named arguments for macros
09fedb8 Fixed fatal error for unknown macro
9e96837 Refactored parsing of macros
2013-08-03 17:51:29 +02:00
Fabien Potencier e3e366928b merged branch h2s/embed-error-line (PR #1140)
This PR was squashed before being merged into the master branch (closes #1140).

Discussion
----------

Fix for {% embed %} error line number bug

This deals with issue #958. I've gone into a lot of detail about the fix itself in the commit message for 12cc0a0, so I won't repeat any of that here. Take a look and let me know what you think!

Commits
-------

270b791 Fix for {% embed %} error line number bug
2013-08-03 17:15:16 +02:00
Henry Smith 270b791ed3 Fix for {% embed %} error line number bug 2013-08-03 17:15:16 +02:00
Martin Hasoň 3004ba19d4 Added support for directly call macros defined in the same template 2013-07-29 23:14:04 +02:00
Martin Hasoň 63615a6cc3 Added support for named arguments for macros 2013-07-29 23:13:25 +02:00
Fabien Potencier cefa33adff moved a test to the right place (refs #1146) 2013-07-24 05:14:54 +02:00
Tugdual Saunier dfc335fd4e Added test case for issue #1143 2013-07-23 22:04:57 +02:00
Tugdual Saunier 4ce9cbf486 Added test case for issue #1126 2013-07-23 21:36:05 +02:00
Martin Hasoň 09fedb80f8 Fixed fatal error for unknown macro 2013-07-16 10:46:54 +02:00
Martin Hasoň 9e96837827 Refactored parsing of macros 2013-07-16 10:43:52 +02:00
Chris Smith f80bab25d3 Use a constant for the main namespace 2013-06-28 10:26:52 +01:00
Fabien Potencier 6f0753f0ff Revert "Fixed PSR-0 in tests"
This reverts commit b5928de258.
2013-06-27 08:24:36 +02:00
Fabien Potencier 3976606739 merged branch hason/patch1 (PR #1080)
This PR was merged into the master branch.

Discussion
----------

Small fixes

Commits
-------

a6205c5 Fixed exception message in Call
b5928de Fixed PSR-0 in tests
2013-06-27 08:24:31 +02:00
Christophe Coevoet 3bc113be2a Made the include function safe for the autoescaping
This fixes a regression introduced in ba88c75557
Fixes #1097
2013-05-29 15:08:43 +02:00
Fabien Potencier f6c00587f8 added the possibility to ignore the filesystem constructor argument (closes #1104) 2013-05-27 08:08:37 +02:00
Fabien Potencier 6939565867 added support for object instances as the second argument of the constant test (closes #1100) 2013-05-23 18:28:53 +02:00
Fabien Potencier ba88c75557 fixed the include function when used in an assignment (closes #1095) 2013-05-17 12:06:31 +02:00
Martin Hasoň 8a662f2ab3 Fixed Twig_Loader_Chain::exists for a loader which implements Twig_ExistsLoaderInterface 2013-05-15 12:37:17 +02:00
Martin Hasoň a6205c55f3 Fixed exception message in Call 2013-05-08 21:49:15 +02:00
Martin Hasoň b5928de258 Fixed PSR-0 in tests 2013-05-07 22:51:00 +02:00
Fabien Potencier cbbbab9065 merged branch Tobion/patch-1 (PR #1030)
This PR was merged into the master branch.

Discussion
----------

fix numeric & boolean & float keys in array

Reopened PR of #878

Commits
-------

2c56b70 Merge pull request #3 from tucksaun/patch-1
17d6cc7 [ext] fixed tabs
46012ce [ext] improvements
21f8062 [ext] code cleaning
9347c52 [ext] updated PHP code documenting C code
b41ce60 updated C extension accordingly
e5291e1 rename item to attribute in the exception message because that's the term that is used in twig, e.g. the  function
a93f0dc further improved exception message and distinguish array_call and any_call access
26bac14 added tests for array access with confusable keys
db744d5 fix test that that would not fail if no exception is thrown
9ea16ec refactored getAttribute
6fb5afa improved error message for non-existent or invalid attributes
fdfd506 added changelog entry about fixed boolean array access
da616c5 fixed getAttribute for array access with a boolean or float key
b6acf9d updated CHANGELOG
c4d5b3f added some unit tests for previous merge
e84448b fix numeric keys in array
2013-05-07 20:56:07 +02:00
Jordi Boggiano d753241ebb Optimize resume after for loops by using + vs array_merge 2013-05-06 15:11:10 +02:00
Fabien Potencier c8fe253890 changed ☃ to § in tests (closes #996) 2013-05-01 20:44:33 +02:00
Fabien Potencier 9ec7e766fb fixed a unit test when run in isolation 2013-05-01 20:28:29 +02:00
Fabien Potencier 135b618ff9 enforced usage of named arguments after positional ones 2013-05-01 20:07:00 +02:00
Martin Hasoň 19869ce00c Fixed autoloader registration for tests if phpunit is installed as package together with Twig 2013-04-22 23:29:01 +02:00
Rick Prent 3d19a2eed5 Fixed twig filesystemloader security issue + test (closes #1026) 2013-04-08 14:15:31 +02:00
Tobias Schultze e5291e1be1 rename item to attribute in the exception message because that's the term that is used in twig, e.g. the function 2013-03-15 12:00:26 +01:00
Tobias Schultze a93f0dca38 further improved exception message and distinguish array_call and any_call access 2013-03-15 12:00:26 +01:00
Tobias Schultze 26bac14c76 added tests for array access with confusable keys
array keys like boolean, numeric but string, floats, null
2013-03-15 12:00:25 +01:00
Tobias Schultze db744d5e51 fix test that that would not fail if no exception is thrown 2013-03-15 12:00:24 +01:00
Tobias Schultze 9ea16ec643 refactored getAttribute 2013-03-15 12:00:23 +01:00
Tobias Schultze 6fb5afa28f improved error message for non-existent or invalid attributes 2013-03-15 12:00:22 +01:00
Fabien Potencier c4d5b3ffdb added some unit tests for previous merge 2013-03-15 11:56:03 +01:00
Pascal Borreli 49488b8f24 Fixed typos 2013-03-10 02:06:44 +00:00