Browse code

Merge branch '1.x' into 2.x

* 1.x:
use HTTPS whenever possible

Fabien Potencier authored on 20/04/2018 06:09:12
Showing 32 changed files
... ...
@@ -530,7 +530,7 @@ to host all the specific tags and filters you want to add to Twig.
530 530
 .. note::
531 531
 
532 532
     Before writing your own extensions, have a look at the Twig official
533
-    extension repository: http://github.com/twigphp/Twig-extensions.
533
+    extension repository: https://github.com/twigphp/Twig-extensions.
534 534
 
535 535
 An extension is a class that implements the following interface::
536 536
 
... ...
@@ -912,6 +912,6 @@ Testing the node visitors can be complex, so extend your test cases from
912 912
 ``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
913 913
 `tests/Twig/Node`_ directory.
914 914
 
915
-.. _`rot13`:                   http://www.php.net/manual/en/function.str-rot13.php
915
+.. _`rot13`:                   https://secure.php.net/manual/en/function.str-rot13.php
916 916
 .. _`tests/Twig/Fixtures`:     https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Fixtures
917 917
 .. _`tests/Twig/Node`:         https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Node
... ...
@@ -15,4 +15,4 @@ The ``abs`` filter returns the absolute value.
15 15
 
16 16
     Internally, Twig uses the PHP `abs`_ function.
17 17
 
18
-.. _`abs`: http://php.net/abs
18
+.. _`abs`: https://secure.php.net/abs
... ...
@@ -19,4 +19,4 @@ Arguments
19 19
 * ``to``:   The output charset
20 20
 * ``from``: The input charset
21 21
 
22
-.. _`iconv`:    http://php.net/iconv
22
+.. _`iconv`:    https://secure.php.net/iconv
... ...
@@ -75,8 +75,8 @@ Arguments
75 75
 * ``format``:   The date format
76 76
 * ``timezone``: The date timezone
77 77
 
78
-.. _`strtotime`:            http://www.php.net/strtotime
79
-.. _`DateTime`:             http://www.php.net/DateTime
80
-.. _`DateInterval`:         http://www.php.net/DateInterval
81
-.. _`date`:                 http://www.php.net/date
82
-.. _`DateInterval::format`: http://www.php.net/DateInterval.format
78
+.. _`strtotime`:            https://secure.php.net/strtotime
79
+.. _`DateTime`:             https://secure.php.net/DateTime
80
+.. _`DateInterval`:         https://secure.php.net/DateInterval
81
+.. _`date`:                 https://secure.php.net/date
82
+.. _`DateInterval::format`: https://secure.php.net/DateInterval.format
... ...
@@ -16,5 +16,5 @@ Arguments
16 16
 
17 17
 * ``modifier``: The modifier
18 18
 
19
-.. _`strtotime`: http://www.php.net/strtotime
20
-.. _`DateTime`:  http://www.php.net/DateTime
19
+.. _`strtotime`: https://secure.php.net/strtotime
20
+.. _`DateTime`:  https://secure.php.net/DateTime
... ...
@@ -106,4 +106,4 @@ Arguments
106 106
 * ``strategy``: The escaping strategy
107 107
 * ``charset``:  The string charset
108 108
 
109
-.. _`htmlspecialchars`: http://php.net/htmlspecialchars
109
+.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars
... ...
@@ -19,4 +19,4 @@ a string:
19 19
 
20 20
     It also works with objects implementing the `Traversable`_ interface.
21 21
 
22
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
22
+.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
... ...
@@ -11,6 +11,6 @@ The ``format`` filter formats a given string by replacing the placeholders
11 11
     {# outputs I like foo and bar
12 12
        if the foo parameter equals to the foo string. #}
13 13
 
14
-.. _`sprintf`: http://www.php.net/sprintf
14
+.. _`sprintf`: https://secure.php.net/sprintf
15 15
 
16 16
 .. seealso:: :doc:`replace<replace>`
... ...
@@ -17,5 +17,5 @@ Arguments
17 17
 * ``options``: A bitmask of `json_encode options`_ (``{{
18 18
   data|json_encode(constant('JSON_PRETTY_PRINT')) }}``)
19 19
 
20
-.. _`json_encode`: http://php.net/json_encode
21
-.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php
20
+.. _`json_encode`: https://secure.php.net/json_encode
21
+.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php
... ...
@@ -19,4 +19,4 @@ a string:
19 19
 
20 20
     It also works with objects implementing the `Traversable`_ interface.
21 21
 
22
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
22
+.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
... ...
@@ -45,4 +45,4 @@ overridden.
45 45
     Internally, Twig uses the PHP `array_merge`_ function. It supports
46 46
     Traversable objects by transforming those to arrays.
47 47
 
48
-.. _`array_merge`: http://php.net/array_merge
48
+.. _`array_merge`: https://secure.php.net/array_merge
... ...
@@ -47,4 +47,4 @@ Arguments
47 47
 * ``decimal_point``: The character(s) to use for the decimal point
48 48
 * ``thousand_sep``:   The character(s) to use for the thousands separator
49 49
 
50
-.. _`number_format`: http://php.net/number_format
50
+.. _`number_format`: https://secure.php.net/number_format
... ...
@@ -41,4 +41,4 @@ Arguments
41 41
 
42 42
 * ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.
43 43
 
44
-.. _`Traversable`: http://php.net/Traversable
44
+.. _`Traversable`: https://secure.php.net/Traversable
... ...
@@ -62,7 +62,7 @@ Arguments
62 62
 * ``length``:        The size of the slice
63 63
 * ``preserve_keys``: Whether to preserve key or not (when the input is an array)
64 64
 
65
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
66
-.. _`array_slice`: http://php.net/array_slice
67
-.. _`mb_substr` :  http://php.net/mb-substr
68
-.. _`substr`:      http://php.net/substr
65
+.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
66
+.. _`array_slice`: https://secure.php.net/array_slice
67
+.. _`mb_substr` :  https://secure.php.net/mb-substr
68
+.. _`substr`:      https://secure.php.net/substr
... ...
@@ -15,4 +15,4 @@ The ``sort`` filter sorts an array:
15 15
     association. It supports Traversable objects by transforming
16 16
     those to arrays.
17 17
 
18
-.. _`asort`: http://php.net/asort
18
+.. _`asort`: https://secure.php.net/asort
... ...
@@ -46,5 +46,5 @@ Arguments
46 46
 * ``delimiter``: The delimiter
47 47
 * ``limit``:     The limit argument
48 48
 
49
-.. _`explode`:   http://php.net/explode
50
-.. _`str_split`: http://php.net/str_split
49
+.. _`explode`:   https://secure.php.net/explode
50
+.. _`str_split`: https://secure.php.net/str_split
... ...
@@ -26,4 +26,4 @@ Arguments
26 26
 
27 27
 * ``allowable_tags``: Tags which should not be stripped
28 28
 
29
-.. _`strip_tags`: http://php.net/strip_tags
29
+.. _`strip_tags`: https://secure.php.net/strip_tags
... ...
@@ -34,6 +34,6 @@ Arguments
34 34
 * ``side``: The default is to strip from the left and the right (`both`) sides, but `left`
35 35
   and `right` will strip from either the left side or right side only
36 36
 
37
-.. _`trim`: http://php.net/trim
38
-.. _`ltrim`: http://php.net/ltrim
39
-.. _`rtrim`: http://php.net/rtrim
37
+.. _`trim`: https://secure.php.net/trim
38
+.. _`ltrim`: https://secure.php.net/ltrim
39
+.. _`rtrim`: https://secure.php.net/rtrim
... ...
@@ -19,4 +19,4 @@ or an array as query string:
19 19
 
20 20
     Internally, Twig uses the PHP ``rawurlencode``.
21 21
 
22
-.. _`rawurlencode`:     http://php.net/rawurlencode
22
+.. _`rawurlencode`: https://secure.php.net/rawurlencode
... ...
@@ -43,4 +43,4 @@ Arguments
43 43
 * ``date``:     The date
44 44
 * ``timezone``: The timezone
45 45
 
46
-.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php
46
+.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php
... ...
@@ -62,5 +62,5 @@ Arguments
62 62
 
63 63
 * ``context``: The context to dump
64 64
 
65
-.. _`XDebug`:   http://xdebug.org/docs/display
66
-.. _`var_dump`: http://php.net/var_dump
65
+.. _`XDebug`:   https://xdebug.org/docs/display
66
+.. _`var_dump`: https://secure.php.net/var_dump
... ...
@@ -20,4 +20,4 @@ Arguments
20 20
 
21 21
 * ``values``: The values
22 22
 
23
-.. _`mt_rand`: http://php.net/mt_rand
23
+.. _`mt_rand`: https://secure.php.net/mt_rand
... ...
@@ -55,4 +55,4 @@ Arguments
55 55
 * ``high``: The highest possible value of the sequence.
56 56
 * ``step``: The increment between elements of the sequence.
57 57
 
58
-.. _`range`: http://php.net/range
58
+.. _`range`: https://secure.php.net/range
... ...
@@ -7,4 +7,4 @@ Install `Composer`_ and run the following command to get the latest version:
7 7
 
8 8
     composer require "twig/twig:^2.0"
9 9
 
10
-.. _`Composer`:      https://getcomposer.org/download/
10
+.. _`Composer`: https://getcomposer.org/download/
... ...
@@ -147,7 +147,7 @@ parent's full, unambiguous template path in the extends tag:
147 147
 .. note::
148 148
 
149 149
     This recipe was inspired by the following Django wiki page:
150
-    http://code.djangoproject.com/wiki/ExtendingTemplates
150
+    https://code.djangoproject.com/wiki/ExtendingTemplates
151 151
 
152 152
 Customizing the Syntax
153 153
 ----------------------
... ...
@@ -524,4 +524,4 @@ include in your templates:
524 524
             'tag_variable' => array('{[', ']}'),
525 525
         )));
526 526
 
527
-.. _callback: http://www.php.net/manual/en/function.is-callable.php
527
+.. _callback: https://secure.php.net/manual/en/function.is-callable.php
... ...
@@ -11,4 +11,4 @@ The ``flush`` tag tells Twig to flush the output buffer:
11 11
 
12 12
     Internally, Twig uses the PHP `flush`_ function.
13 13
 
14
-.. _`flush`: http://php.net/flush
14
+.. _`flush`: https://secure.php.net/flush
... ...
@@ -879,12 +879,12 @@ Extension<creating_extensions>` chapter.
879 879
 .. _`Twig syntax plugin`:         http://plugins.netbeans.org/plugin/37069/php-twig
880 880
 .. _`Twig plugin`:                https://github.com/pulse00/Twig-Eclipse-Plugin
881 881
 .. _`Twig language definition`:   https://github.com/gabrielcorpse/gedit-twig-template-language
882
-.. _`extension repository`:       http://github.com/twigphp/Twig-extensions
882
+.. _`extension repository`:       https://github.com/twigphp/Twig-extensions
883 883
 .. _`Twig syntax mode`:           https://github.com/bobthecow/Twig-HTML.mode
884 884
 .. _`other Twig syntax mode`:     https://github.com/muxx/Twig-HTML.mode
885 885
 .. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig
886 886
 .. _`web-mode.el`:                http://web-mode.org/
887
-.. _`regular expressions`:        http://php.net/manual/en/pcre.pattern.php
887
+.. _`regular expressions`:        https://secure.php.net/manual/en/pcre.pattern.php
888 888
 .. _`PHP-twig for atom`:          https://github.com/reesef/php-twig
889
-.. _`TwigFiddle`:                 http://twigfiddle.com/
889
+.. _`TwigFiddle`:                 https://twigfiddle.com/
890 890
 .. _`Twig pack`:                  https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack
... ...
@@ -15,8 +15,8 @@
15 15
  *
16 16
  * This parser implements a "Precedence climbing" algorithm.
17 17
  *
18
- * @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
19
- * @see http://en.wikipedia.org/wiki/Operator-precedence_parser
18
+ * @see https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
19
+ * @see https://en.wikipedia.org/wiki/Operator-precedence_parser
20 20
  *
21 21
  * @author Fabien Potencier <fabien@symfony.com>
22 22
  *
... ...
@@ -908,7 +908,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
908 908
 
909 909
     switch ($strategy) {
910 910
         case 'html':
911
-            // see http://php.net/htmlspecialchars
911
+            // see https://secure.php.net/htmlspecialchars
912 912
 
913 913
             // Using a static variable to avoid initializing the array
914 914
             // each time the function is called. Moving the declaration on the
... ...
@@ -18,7 +18,7 @@
18 18
  * {% endsandbox %}
19 19
  * </pre>
20 20
  *
21
- * @see http://www.twig-project.org/doc/api.html#sandbox-extension for details
21
+ * @see https://twig.symfony.com/doc/api.html#sandbox-extension for details
22 22
  */
23 23
 final class Twig_TokenParser_Sandbox extends Twig_TokenParser
24 24
 {
... ...
@@ -21,7 +21,7 @@
21 21
  * {% block content %}{% endblock %}
22 22
  * </pre>
23 23
  *
24
- * @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details.
24
+ * @see https://twig.symfony.com/doc/templates.html#horizontal-reuse for details.
25 25
  */
26 26
 final class Twig_TokenParser_Use extends Twig_TokenParser
27 27
 {
... ...
@@ -3,8 +3,8 @@
3 3
 /**
4 4
  * This class is adapted from code coming from Zend Framework.
5 5
  *
6
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7
- * @license   http://framework.zend.com/license/new-bsd New BSD License
6
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com)
7
+ * @license   https://framework.zend.com/license/new-bsd New BSD License
8 8
  */
9 9
 class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
10 10
 {