mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
fixed PHP 7.4 support
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
* 1.41.0 (2019-XX-XX)
|
* 1.41.0 (2019-XX-XX)
|
||||||
|
|
||||||
|
* fixed support for PHP 7.4
|
||||||
* added "filter", "map", and "reduce" filters (and support for arrow functions)
|
* added "filter", "map", and "reduce" filters (and support for arrow functions)
|
||||||
* fixed partial output leak when a PHP fatal error occurs
|
* fixed partial output leak when a PHP fatal error occurs
|
||||||
* optimized context access on PHP 7.4
|
* optimized context access on PHP 7.4
|
||||||
|
|||||||
+1
-1
@@ -262,7 +262,7 @@ class Lexer implements \Twig_LexerInterface
|
|||||||
if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) {
|
if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) {
|
||||||
// whitespace_trim detected ({%-, {{- or {#-)
|
// whitespace_trim detected ({%-, {{- or {#-)
|
||||||
$text = rtrim($text);
|
$text = rtrim($text);
|
||||||
} else {
|
} elseif ($this->options['whitespace_line_trim'] === $this->positions[2][$this->position][0]) {
|
||||||
// whitespace_line_trim detected ({%~, {{~ or {#~)
|
// whitespace_line_trim detected ({%~, {{~ or {#~)
|
||||||
// don't trim \r and \n
|
// don't trim \r and \n
|
||||||
$text = rtrim($text, " \t\0\x0B");
|
$text = rtrim($text, " \t\0\x0B");
|
||||||
|
|||||||
Reference in New Issue
Block a user