Skip to content

Commit

Permalink
Merge tag 'v1.35.4'
Browse files Browse the repository at this point in the history
created tag v1.35.4

# gpg: directory `/c/Users/Brad/.gnupg' created
# gpg: new configuration file `/c/Users/Brad/.gnupg/gpg.conf' created
# gpg: WARNING: options in `/c/Users/Brad/.gnupg/gpg.conf' are not yet active during this run
# gpg: keyring `/c/Users/Brad/.gnupg/pubring.gpg' created
# gpg: Signature made Fri Jul 13 00:12:20 2018 PDT
# gpg:                using DSA key EB8AA69A566C0795
# gpg: Can't check signature: public key not found
  • Loading branch information
angrybrad committed Jul 25, 2018
2 parents 63f332b + 7e081e9 commit d8d8dad
Show file tree
Hide file tree
Showing 79 changed files with 353 additions and 178 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ cache:
- $HOME/.composer/cache/files

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- nightly

env:
- TWIG_EXT=no
- TWIG_EXT=yes

before_install:
# turn off XDebug
Expand All @@ -40,10 +39,16 @@ script: |
matrix:
fast_finish: true
exclude:
- php: 7.0
include:
- php: 5.3
dist: precise
env: TWIG_EXT=yes
- php: 7.1
- php: 5.3
dist: precise
env: TWIG_EXT=no
- php: 5.4
env: TWIG_EXT=yes
- php: nightly
- php: 5.5
env: TWIG_EXT=yes
- php: 5.6
env: TWIG_EXT=yes
25 changes: 25 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
* 1.35.4 (2018-07-13)

* ensured that syntax errors are triggered with the right line
* added the Symfony ctype polyfill as a dependency
* "js" filter now produces valid JSON

* 1.35.3 (2018-03-20)

* fixed block names unicity
* fixed counting children of SimpleXMLElement objects
* added missing else clause to avoid infinite loops
* fixed .. (range operator) in sandbox policy

* 1.35.2 (2018-03-03)

* fixed a regression in the way the profiler is registered in templates

* 1.35.1 (2018-03-02)

* added an exception when using "===" instead of "same as"
* fixed possible array to string conversion concealing actual error
* made variable names deterministic in compiled templates
* fixed length filter when passing an instance of IteratorAggregate
* fixed Environment::resolveTemplate to accept instances of TemplateWrapper

* 1.35.0 (2017-09-27)

* added Twig_Profiler_Profile::reset()
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2017 by the Twig Team.
Copyright (c) 2009-2018 by the Twig Team.

Some rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ More Information

Read the `documentation`_ for more information.

.. _documentation: http://twig.sensiolabs.org/documentation
.. _documentation: https://twig.symfony.com/documentation
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "library",
"description": "Twig, the flexible, fast, and secure template language for PHP",
"keywords": ["templating"],
"homepage": "http://twig.sensiolabs.org",
"homepage": "https://twig.symfony.com",
"license": "BSD-3-Clause",
"authors": [
{
Expand All @@ -14,7 +14,7 @@
},
{
"name": "Twig Team",
"homepage": "http://twig.sensiolabs.org/contributors",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
},
{
Expand All @@ -27,11 +27,12 @@
"forum": "https://groups.google.com/forum/#!forum/twig-users"
},
"require": {
"php": ">=5.3.3"
"php": ">=5.3.3",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
"symfony/debug": "~2.7",
"symfony/phpunit-bridge": "^3.3",
"symfony/debug": "^2.7",
"psr/container": "^1.0"
},
"autoload": {
Expand Down
8 changes: 4 additions & 4 deletions doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ to host all the specific tags and filters you want to add to Twig.
.. note::

Before writing your own extensions, have a look at the Twig official
extension repository: http://github.com/twigphp/Twig-extensions.
extension repository: https://github.com/twigphp/Twig-extensions.

An extension is a class that implements the following interface::

Expand Down Expand Up @@ -800,7 +800,7 @@ The simplest way to use methods is to define them on the extension itself::

public function rot13($value)
{
return $rot13Provider->rot13($value);
return $this->rot13Provider->rot13($value);
}
}

Expand Down Expand Up @@ -849,7 +849,7 @@ It is now possible to move the runtime logic to a new

public function rot13($value)
{
return $rot13Provider->rot13($value);
return $this->rot13Provider->rot13($value);
}
}

Expand Down Expand Up @@ -957,6 +957,6 @@ Testing the node visitors can be complex, so extend your test cases from
``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
`tests/Twig/Node`_ directory.

.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
.. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php
.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures
.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node
6 changes: 3 additions & 3 deletions doc/advanced_legacy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ to host all the specific tags and filters you want to add to Twig.
.. note::

Before writing your own extensions, have a look at the Twig official
extension repository: http://github.com/twigphp/Twig-extensions.
extension repository: https://github.com/twigphp/Twig-extensions.

An extension is a class that implements the following interface::

Expand Down Expand Up @@ -879,7 +879,7 @@ Testing the node visitors can be complex, so extend your test cases from
``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
`tests/Twig/Node`_ directory.

.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register
.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
.. _`spl_autoload_register()`: https://secure.php.net/spl_autoload_register
.. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php
.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures
.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node
2 changes: 1 addition & 1 deletion doc/filters/abs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The ``abs`` filter returns the absolute value.

Internally, Twig uses the PHP `abs`_ function.

.. _`abs`: http://php.net/abs
.. _`abs`: https://secure.php.net/abs
4 changes: 2 additions & 2 deletions doc/filters/convert_encoding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Arguments
* ``to``: The output charset
* ``from``: The input charset

.. _`iconv`: http://php.net/iconv
.. _`mbstring`: http://php.net/mbstring
.. _`iconv`: https://secure.php.net/iconv
.. _`mbstring`: https://secure.php.net/mbstring
10 changes: 5 additions & 5 deletions doc/filters/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Arguments
* ``format``: The date format
* ``timezone``: The date timezone

.. _`strtotime`: http://www.php.net/strtotime
.. _`DateTime`: http://www.php.net/DateTime
.. _`DateInterval`: http://www.php.net/DateInterval
.. _`date`: http://www.php.net/date
.. _`DateInterval::format`: http://www.php.net/DateInterval.format
.. _`strtotime`: https://secure.php.net/strtotime
.. _`DateTime`: https://secure.php.net/DateTime
.. _`DateInterval`: https://secure.php.net/DateInterval
.. _`date`: https://secure.php.net/date
.. _`DateInterval::format`: https://secure.php.net/DateInterval.format
4 changes: 2 additions & 2 deletions doc/filters/date_modify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Arguments

* ``modifier``: The modifier

.. _`strtotime`: http://www.php.net/strtotime
.. _`DateTime`: http://www.php.net/DateTime
.. _`strtotime`: https://secure.php.net/strtotime
.. _`DateTime`: https://secure.php.net/DateTime
2 changes: 1 addition & 1 deletion doc/filters/escape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ Arguments
* ``strategy``: The escaping strategy
* ``charset``: The string charset

.. _`htmlspecialchars`: http://php.net/htmlspecialchars
.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars
2 changes: 1 addition & 1 deletion doc/filters/first.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ a string:

It also works with objects implementing the `Traversable`_ interface.

.. _`Traversable`: http://php.net/manual/en/class.traversable.php
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
2 changes: 1 addition & 1 deletion doc/filters/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ The ``format`` filter formats a given string by replacing the placeholders
{# outputs I like foo and bar
if the foo parameter equals to the foo string. #}
.. _`sprintf`: http://www.php.net/sprintf
.. _`sprintf`: https://secure.php.net/sprintf

.. seealso:: :doc:`replace<replace>`
4 changes: 2 additions & 2 deletions doc/filters/json_encode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Arguments
* ``options``: A bitmask of `json_encode options`_ (``{{
data|json_encode(constant('JSON_PRETTY_PRINT')) }}``)

.. _`json_encode`: http://php.net/json_encode
.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php
.. _`json_encode`: https://secure.php.net/json_encode
.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php
2 changes: 1 addition & 1 deletion doc/filters/last.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ a string:

It also works with objects implementing the `Traversable`_ interface.

.. _`Traversable`: http://php.net/manual/en/class.traversable.php
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
2 changes: 2 additions & 0 deletions doc/filters/length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ return value of the ``count()`` method.
For objects that implement the ``__toString()`` magic method (and not ``Countable``),
it will return the length of the string provided by that method.

For objects that implement the ``IteratorAggregate`` interface, ``length`` will use the return value of the ``iterator_count()`` method.

.. code-block:: jinja
{% if users|length > 10 %}
Expand Down
2 changes: 1 addition & 1 deletion doc/filters/merge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ overridden.
Internally, Twig uses the PHP `array_merge`_ function. It supports
Traversable objects by transforming those to arrays.

.. _`array_merge`: http://php.net/array_merge
.. _`array_merge`: https://secure.php.net/array_merge
2 changes: 1 addition & 1 deletion doc/filters/number_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ Arguments
* ``decimal_point``: The character(s) to use for the decimal point
* ``thousand_sep``: The character(s) to use for the thousands separator

.. _`number_format`: http://php.net/number_format
.. _`number_format`: https://secure.php.net/number_format
6 changes: 6 additions & 0 deletions doc/filters/replace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ The ``replace`` filter formats a given string by replacing the placeholders
{# outputs I like foo and bar
if the foo parameter equals to the foo string. #}
{# using % as a delimiter is purely conventional and optional #}
{{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }}
{# outputs I like foo and bar #}
Arguments
---------

Expand Down
2 changes: 1 addition & 1 deletion doc/filters/reverse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Arguments

* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.

.. _`Traversable`: http://php.net/Traversable
.. _`Traversable`: https://secure.php.net/Traversable
8 changes: 4 additions & 4 deletions doc/filters/slice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Arguments
* ``length``: The size of the slice
* ``preserve_keys``: Whether to preserve key or not (when the input is an array)

.. _`Traversable`: http://php.net/manual/en/class.traversable.php
.. _`array_slice`: http://php.net/array_slice
.. _`mb_substr` : http://php.net/mb-substr
.. _`substr`: http://php.net/substr
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
.. _`array_slice`: https://secure.php.net/array_slice
.. _`mb_substr` : https://secure.php.net/mb-substr
.. _`substr`: https://secure.php.net/substr
2 changes: 1 addition & 1 deletion doc/filters/sort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The ``sort`` filter sorts an array:
association. It supports Traversable objects by transforming
those to arrays.

.. _`asort`: http://php.net/asort
.. _`asort`: https://secure.php.net/asort
14 changes: 7 additions & 7 deletions doc/filters/split.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ of strings:
You can also pass a ``limit`` argument:

* If ``limit`` is positive, the returned array will contain a maximum of
limit elements with the last element containing the rest of string;
* If ``limit`` is positive, the returned array will contain a maximum of
limit elements with the last element containing the rest of string;

* If ``limit`` is negative, all components except the last -limit are
returned;
* If ``limit`` is negative, all components except the last -limit are
returned;

* If ``limit`` is zero, then this is treated as 1.
* If ``limit`` is zero, then this is treated as 1.

.. code-block:: jinja
Expand Down Expand Up @@ -49,5 +49,5 @@ Arguments
* ``delimiter``: The delimiter
* ``limit``: The limit argument

.. _`explode`: http://php.net/explode
.. _`str_split`: http://php.net/str_split
.. _`explode`: https://secure.php.net/explode
.. _`str_split`: https://secure.php.net/str_split
2 changes: 1 addition & 1 deletion doc/filters/striptags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Arguments

* ``allowable_tags``: Tags which should not be stripped

.. _`strip_tags`: http://php.net/strip_tags
.. _`strip_tags`: https://secure.php.net/strip_tags
6 changes: 3 additions & 3 deletions doc/filters/trim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ Arguments
* ``side``: The default is to strip from the left and the right (`both`) sides, but `left`
and `right` will strip from either the left side or right side only

.. _`trim`: http://php.net/trim
.. _`ltrim`: http://php.net/ltrim
.. _`rtrim`: http://php.net/rtrim
.. _`trim`: https://secure.php.net/trim
.. _`ltrim`: https://secure.php.net/ltrim
.. _`rtrim`: https://secure.php.net/rtrim
6 changes: 3 additions & 3 deletions doc/filters/url_encode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ or an array as query string:
that as of Twig 1.16.0, ``urlencode`` **always** uses ``rawurlencode`` (the
``raw`` argument was removed.)

.. _`urlencode`: http://php.net/urlencode
.. _`rawurlencode`: http://php.net/rawurlencode
.. _`http_build_query`: http://php.net/http_build_query
.. _`urlencode`: https://secure.php.net/urlencode
.. _`rawurlencode`: https://secure.php.net/rawurlencode
.. _`http_build_query`: https://secure.php.net/http_build_query
2 changes: 1 addition & 1 deletion doc/functions/block.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ times, use the ``block`` function:
{% block body %}{% endblock %}
The ``block`` function can also be used to display one block of another
The ``block`` function can also be used to display one block from another
template:

.. code-block:: jinja
Expand Down
2 changes: 1 addition & 1 deletion doc/functions/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Arguments
* ``date``: The date
* ``timezone``: The timezone

.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php
.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php
4 changes: 2 additions & 2 deletions doc/functions/dump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ Arguments

* ``context``: The context to dump

.. _`XDebug`: http://xdebug.org/docs/display
.. _`var_dump`: http://php.net/var_dump
.. _`XDebug`: https://xdebug.org/docs/display
.. _`var_dump`: https://secure.php.net/var_dump
2 changes: 1 addition & 1 deletion doc/functions/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Arguments

* ``values``: The values

.. _`mt_rand`: http://php.net/mt_rand
.. _`mt_rand`: https://secure.php.net/mt_rand
2 changes: 1 addition & 1 deletion doc/functions/range.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ Arguments
* ``high``: The highest possible value of the sequence.
* ``step``: The increment between elements of the sequence.

.. _`range`: http://php.net/range
.. _`range`: https://secure.php.net/range
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ PHP code but only provides an optimized version of the
.. _`download page`: https://github.com/twigphp/Twig/tags
.. _`Composer`: https://getcomposer.org/download/
.. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild
.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6
.. _`Zend Server FAQ`: https://www.zend.com/en/products/server/faq#faqD6
Loading

0 comments on commit d8d8dad

Please sign in to comment.