This PR was merged into the master branch.
Discussion
----------
Made the include function safe for the autoescaping
This fixes a regression introduced in ba88c75557Fixes#1097
I have not updated the changelog as the regression is not part of a release yet
Commits
-------
3bc113b Made the include function safe for the autoescaping
This PR was merged into the master branch.
Discussion
----------
Update slice.rst
I was (somehow) misled by the example, thinking `'1234'[2:]` outputs `34` because it `2:` mean copy the last 2 characters...
This happens when you are in a hurry and didn't look into the text.
Let makes it less ambiguous.
Commits
-------
3ddff67 Update slice.rst
This PR was merged into the master branch.
Discussion
----------
change mention of print to sprintf in format filter
The format specifiers are actually mentioned on the [sprintf](http://php.net/sprintf) page
Commits
-------
5746c11 change mention of print to sprintf in format filter
I was (somehow) misled by the example, thinking `'1234'[2:]` outputs `34` because it `2:` mean copy the last 2 characters...
This happens when you are in a hurry and didn't look into the text.
Let makes it less ambiguous.
This PR was squashed before being merged into the master branch (closes#1103).
Discussion
----------
Added info about variable declarations inside a loop
Commits
-------
d5f4ec3 Added info about variable declarations inside a loop
This PR was merged into the master branch.
Discussion
----------
Fixed Twig_Loader_Chain::exists for a loader which implements Twig_ExistsLoaderInterface
Commits
-------
8a662f2 Fixed Twig_Loader_Chain::exists for a loader which implements Twig_ExistsLoaderInterface
This PR was squashed before being merged into the master branch (closes#1083).
Discussion
----------
Adjusted backtrace call to reduce memory usage
Commits
-------
cf3ee20 Adjusted backtrace call to reduce memory usage
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
This PR was merged into the master branch.
Discussion
----------
Some more optimizations
Please look at commits one by one. Overall this makes the twig_escape_filter almost 20% faster here for happy path (escaping string for html with UTF-8) on 1000 calls. Still pretty darn slow, but faster.
Commits
-------
d886b12 Make happy path (strings) faster by avoiding the cast, same perfs for the other cases
97bf5e5 Avoid unnecessary is_object call
c1c0dcc Use uppercased charsets consistently (as in js/css/html_attr strategies)
a23fa62 Add UTF-8 in uppercase since it is so common
c891c53 Avoid strtolower call at every twig_escape_filter call
61f2b2a Use plain string comparison which is twice as fast
d4eec01 Move html case up since it is the most likely to be hit
This PR was merged into the master branch.
Discussion
----------
Optimize resume after for loops by using + vs array_merge
The plus operator seems to be almost twice as fast as array_merge, so I think in this case and given it's compiled code not made for humans it's worth it. The only potential problem is if you use ints as keys then it won't have the same behavior as array_merge, but I don't know if twig supports this at all, and especially I doubt it's a good idea.
Commits
-------
d753241 Optimize resume after for loops by using + vs array_merge
This PR was merged into the master branch.
Discussion
----------
Fixed php doc in Twig/Extension/StringLoader
Commits
-------
95353cb Fixed php doc in Twig/Extension/StringLoader
This PR was merged into the master branch.
Discussion
----------
Optimize initGlobals to do only one merge call
Commits
-------
086088e Optimize initGlobals to do only one merge call
This PR was merged into the master branch.
Discussion
----------
enforced usage of named arguments after positional ones
When we introduced named arguments, the behavior for when both positional and named arguments were used in a call was not clearly defined.
This PR addresses this issue by following Python rules:
* No positional argument after named ones
* No possibility to define an argument with both a positional argument and a named one
This introduces a BC break if people were using positional arguments after named ones, but I would argue that this is never a good idea anyway.
This is an alternative to #995
Commits
-------
135b618 enforced usage of named arguments after positional ones