Commit Graph

2309 Commits

Author SHA1 Message Date
John Berberich 4e1515c3c5 Delimit comment in template using correct syntax
Enclose the comment in '{# #}' instead of beginning line with '#'.
2014-08-22 10:11:09 -04:00
Fabien Potencier e2d2a250d9 minor #1475 Improved exception message while trying to access an attribute from an empty array (phansys, tucksaun)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Improved exception message while trying to access an attribute from an empty array

Rebased #1439 in master and updated twig extension

Commits
-------

759a77d [Ext] updating Twig extension for previous commit
15ce450 Improved exception message while trying to access an attribute from an empty array.
2014-08-06 08:46:32 +02:00
Tugdual Saunier 759a77d040 [Ext] updating Twig extension for previous commit 2014-08-06 07:18:48 +01:00
Javier Spagnoletti 15ce450e32 Improved exception message while trying to access an attribute from an empty array. 2014-08-06 07:18:32 +01:00
Fabien Potencier da2d52b022 updated CHANGELOG 2014-08-05 14:54:54 +02:00
Fabien Potencier 3e6c9551eb changed the way we check for HHVM 2014-08-04 21:55:24 +02:00
Fabien Potencier 1d093a4137 minor #1471 Fixed a test on hhvm (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed a test on hhvm

Commits
-------

0c169ce Fixed a test on hhvm
2014-08-04 21:54:18 +02:00
Martin Hasoň 0c169ce98c Fixed a test on hhvm 2014-08-04 12:46:42 +02:00
Fabien Potencier 54da75aebf bug #1468 Fixed "starts with" a "ends with" operators for non-string arguments (hason)
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
2014-08-03 10:10:53 +02:00
Martin Hasoň 4c26981ce5 Fixed "starts with" a "ends with" operators for non-string arguments 2014-08-02 17:11:21 +02:00
Fabien Potencier 0c508d2703 bug #1452 Fixed 'starts with' operator for empty needle (hason)
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
2014-08-01 17:28:52 +02:00
Martin Hasoň 790305af93 Fixed 'starts with' operator for empty needle 2014-08-01 14:43:36 +02:00
Fabien Potencier 21f0b829f9 added more docs for the if tag 2014-08-01 09:38:44 +02:00
Fabien Potencier c03a7a323a fixed the attribute() function when passing a variable for the arguments 2014-08-01 09:18:16 +02:00
Fabien Potencier 72aa82b9a2 minor #1465 Some minor cleanup (JeroenDeDauw)
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
2014-07-31 15:21:40 +02:00
Fabien Potencier 3ad428fe1d minor #1462 Simplified Twig_Node_Include (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Simplified Twig_Node_Include

Commits
-------

632fe90 Simplified Twig_Node_Include
2014-07-31 15:20:45 +02:00
Fabien Potencier 30d4f2b2b1 minor #1458 Add variables types in error message of twig_array_merge (inalgnu)
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
2014-07-31 13:15:54 +02:00
jeroendedauw e6da6bb0d4 Restore unused var 2014-07-31 12:30:50 +02:00
jeroendedauw d8e1077fd1 Get rid of naming clash
Static code analysis tool did not like this.
Looks like it was wrong before. Tests unchanged though.
2014-07-31 10:38:31 +02:00
jeroendedauw 3e50672029 Remove unused local vars 2014-07-31 10:37:48 +02:00
jeroendedauw 291141f869 Remove unused var 2014-07-31 10:37:40 +02:00
jeroendedauw 99215549a9 Fix type hint
In PHPStorm the inferred type was 'A'
2014-07-31 10:37:12 +02:00
jeroendedauw 1d2b8777d0 Fix type hint
PHPStorm wrongly inferred the type 'Unicode'
2014-07-31 10:36:30 +02:00
Martin Hasoň 632fe90000 Simplified Twig_Node_Include 2014-07-31 09:18:56 +02:00
Inal DJAFAR ea6676d61a add variables types in error message of twig_array_merge 2014-07-30 17:44:54 +02:00
Fabien Potencier 4134169b67 minor #1457 Fixed the matches operator code example (brandonkelly)
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
2014-07-29 13:54:16 +02:00
Brandon Kelly 33dcbc8c76 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.
2014-07-28 11:37:46 -07:00
Fabien Potencier 7d1577ff3c bug #1453 Fix for mb function overload mb_substr acting different (1emming)
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
2014-07-28 15:12:00 +02:00
1emming 214fe52174 Fix for mb function overload mb_substr acting different 2014-07-28 15:11:49 +02:00
Fabien Potencier 5fd428ed76 fixed some typos 2014-07-08 15:46:25 +02:00
Fabien Potencier 82a034c591 minor #1333 Added disambiguation on using raw in expressions (OwlyCode)
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
2014-07-08 15:44:12 +02:00
Fabien Potencier 31e2a79735 minor #1431 Typo in deprecated.rst (barryvdh)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Typo in deprecated.rst

Commits
-------

06ca7f9 Typo in deprecated.rst
2014-07-08 15:42:48 +02:00
Fabien Potencier 11ea5976e3 bumped version to 1.16.1-DEV 2014-07-07 14:54:10 +02:00
Barry vd. Heuvel 06ca7f9837 Typo in deprecated.rst 2014-07-05 14:50:30 +02:00
Fabien Potencier 8ce3711580 prepared the 1.16.0 release v1.16.0 2014-07-05 14:19:05 +02:00
Fabien Potencier eed777f8d8 replaced deprecated divisibleby by divisible by in tests 2014-07-05 14:12:06 +02:00
Fabien Potencier eeeef75f0a replaced deprecated sameas by same as in tests 2014-07-05 14:06:29 +02:00
Fabien Potencier 1e71b52757 fixed some deprecation notices 2014-07-05 14:03:33 +02:00
Fabien Potencier f4c41f78a5 fixed the deprecated docs about PEAR 2014-07-05 13:37:05 +02:00
Fabien Potencier 23efa7b1c2 fixed potential exception 2014-07-05 13:16:15 +02:00
Fabien Potencier 251af26c75 minor #1426 Add 'PHP-twig for atom' package to IDEs support (zoltanradics)
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
2014-07-05 11:31:17 +02:00
Zoltan Radics c90d46988f Add 'PHP-twig for atom' package to IDEs support 2014-07-05 11:31:15 +02:00
Fabien Potencier 96336aba60 minor #1422 Update slice.rst (1emming)
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
2014-06-20 09:26:46 +02:00
Seb Minderhoud 87165e7ea5 Update slice.rst 2014-06-19 09:49:36 +02:00
Fabien Potencier 1c0bec2814 added a note in the docs about the fact that installing the C ext is optional 2014-05-26 17:15:28 +02:00
Fabien Potencier 7c63a7df8a feature #1390 fixed url_encode when raw is false and URL is an array (Tobion, fabpot)
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
2014-05-26 02:34:04 +02:00
Fabien Potencier 1930600e4e fixed url_encode when raw is false and URL is an array 2014-05-26 02:31:15 +02:00
Tobias Schultze 49ba6b4759 removed parameter from url_encode filter
the filter now only uses the more appropriate rawurlencode() which is also more consistent with the escape('url') filter
2014-05-26 02:23:10 +02:00
Fabien Potencier 4a7ef0ce0f updated CHANGELOG 2014-05-26 02:01:07 +02:00
Fabien Potencier f1aee16381 bug #1370 Fixed inheritance in a 'use'-hierarchy (hason)
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
2014-05-26 02:00:46 +02:00