This PR was merged into the 1.16-dev branch.
Discussion
----------
Fixed "starts with" a "ends with" operators for non-string arguments
Commits
-------
4c26981 Fixed "starts with" a "ends with" operators for non-string arguments
This PR was merged into the 1.16-dev branch.
Discussion
----------
Fixed 'starts with' operator for empty needle
Fixes#1432
Commits
-------
790305a Fixed 'starts with' operator for empty needle
This PR was merged into the 1.16-dev branch.
Discussion
----------
Some minor cleanup
Commits
-------
e6da6bb Restore unused var
d8e1077 Get rid of naming clash
3e50672 Remove unused local vars
291141f Remove unused var
9921554 Fix type hint
1d2b877 Fix type hint
This PR was merged into the 1.16-dev branch.
Discussion
----------
Add variables types in error message of twig_array_merge
Commits
-------
ea6676d add variables types in error message of twig_array_merge
This PR was merged into the 1.16-dev branch.
Discussion
----------
Fixed the `matches` operator code example
A customer just pointed out that your `matches` operator code example wasn't working for them, and it ended up being because its backslashes themselves needed to be escaped by additional backslashes. (I've verified this.)
While I was editing it, I also switched to forwardslash delimiters on the regex, since those are much more commonly used than curly brackets. (I hadn't even been aware that curly brackets are allowed.) To back that assertion up, [PHP's official preg_quote() docs](http://php.net/manual/en/function.preg-quote.php) state:
> The `/` is the most commonly used delimiter.
Commits
-------
33dcbc8 Fixed the `matches` operator code example
It wasn't working because the backslashes themselves needed to be escaped by additional backslashes. Also switched to using forwardslashes for the regex delimiters rather than curly brackets.
This PR was squashed before being merged into the 1.16-dev branch (closes#1453).
Discussion
----------
Fix for mb function overload mb_substr acting different
When bug hunting https://github.com/fabpot/Twig/issues/1428 I ran into an issue.
I started out by changing my `php.ini` for the `cli` enviroment, I've added:
`mbstring.func_overload = 2`
Later I tested with adding and removing:
`mbstring.internal_encoding = 'UTF-8'`
It turns out `mb_substr` returns `false` and not `''` when doing something like this:
```php
$item = '';
$start = -1;
$length = 1;
$charset = 'UTF-8';
$a = mb_substr($item, $start, $length, $charset);
var_dump($a);
die;
```
I'm not sure this will fix 1428 since I don't have enough information for this, but this PR should at least fix one issue.
Commits
-------
214fe52 Fix for mb function overload mb_substr acting different
This PR was merged into the 1.16-dev branch.
Discussion
----------
Added disambiguation on using raw in expressions
I recently got in trouble using the ``raw`` filter in a ternary, leading to a value being escaped and me not expecting it. The code was :
```
{{ foo|striptags|length > 250 ? foo|striptags|slice(0, 250) ~ '...' : foo|raw }}
```
When foo's length was under 250 characters, the result of this expression was escaped. Here is the updated documentation to explain why.
Commits
-------
cec2b57 Added disambiguation on using raw in expressions
This PR was squashed before being merged into the 1.16-dev branch (closes#1426).
Discussion
----------
Add 'PHP-twig for atom' package to IDEs support
Since Atom.io editor is growing, i would add this package to the list for people who would like to edit Twig in Atom.
Commits
-------
c90d469 Add 'PHP-twig for atom' package to IDEs support
This PR was merged into the 1.16-dev branch.
Discussion
----------
Update slice.rst
Please state that Twig `slice` is multi-byte safe since it uses `mb_substr` :)
Commits
-------
87165e7 Update slice.rst
This PR was merged into the 1.16-dev branch.
Discussion
----------
fixed url_encode when raw is false and URL is an array
alternative for #1388
Commits
-------
1930600 fixed url_encode when raw is false and URL is an array
49ba6b4 removed parameter from url_encode filter
This PR was merged into the 1.15-dev branch.
Discussion
----------
Fixed inheritance in a 'use'-hierarchy
Fixes#1365
Commits
-------
9e0907e Fixed inheritance in a 'use'-hierarchy
This PR was merged into the 1.15-dev branch.
Discussion
----------
Added isSandbox check around the __toString check in Sandbox extension
The `__toString` policy check currently still happens when the sandbox is disabled
Commits
-------
3ce4202 Added test for sandbox __toString when not enabled
8dfa432 Added isSandbox check around the __toString check
This PR was merged into the 1.15-dev branch.
Discussion
----------
Refactor namespace/shortname parsing into own method
I've written a custom file loader in order for the namespace syntax to match across different resource loading classes. To achieve this I have to replace the loadTemplate method, which includes a lot of logic. While this logic may not be likely to change anytime soon, I'd feel better if the namespace parsing was extracted into its own method so I can replace just that bit.
Commits
-------
9dd3bb8 Refactor namespace/shortname parsing into own method