commit eb5b0c954587cd7b98ac1bc75e82a96b37a6abef Author: Joel Pittet Date: Wed Sep 2 09:00:48 2015 -0700 nits diff --git a/core/lib/Drupal/Component/Utility/SafeMarkup.php b/core/lib/Drupal/Component/Utility/SafeMarkup.php index 2455f55..325f37a 100644 --- a/core/lib/Drupal/Component/Utility/SafeMarkup.php +++ b/core/lib/Drupal/Component/Utility/SafeMarkup.php @@ -200,8 +200,8 @@ public static function checkPlain($text) { * @endcode * - !variable: If the string is safe, it will be inserted as is, with no * sanitization or formatting. If the string is unsafe, a very permissive - * XSS/HTML filter for admin-only use will be applied. Only - * use this when the resulting string is being generated for one of: + * XSS/HTML filter for admin-only use will be applied. Only use this when + * the resulting string is being generated for one of: * - Non-HTML usage, such as a plain-text email. * - Non-direct HTML output, such as a plain-text variable that will be * printed as an HTML attribute value and therefore formatted with diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index dbbd294..df022f1 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -132,7 +132,7 @@ public function getFilters() { // create filters and give them identifiable names. These filters should // only be used in "trans" tags. // @see TwigNodeTrans::compileString() - new \Twig_SimpleFilter('passthrough', [$this, 'passthrough'], array('is_safe' => array('html'))), + new \Twig_SimpleFilter('passthrough', [$this, 'passthrough'], ['is_safe' => ['html']]), new \Twig_SimpleFilter('placeholder', [$this, 'escapePlaceholder'], array('is_safe' => array('html'), 'needs_environment' => TRUE)), // Replace twig's escape filter with our own. diff --git a/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module b/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module index 0f54530..b4f55f6 100644 --- a/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module +++ b/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.module @@ -11,7 +11,13 @@ function twig_extension_test_theme($existing, $type, $theme, $path) { return array( 'twig_extension_test_filter' => array( - 'variables' => array('message' => NULL, 'safe_join_items' => NULL, 'placeholder_text' => NULL, 'passthrough_text' => NULL, 'passthrough_safe_text' => NULL), + 'variables' => array( + 'message' => NULL, + 'safe_join_items' => NULL, + 'placeholder_text' => NULL, + 'passthrough_text' => NULL, + 'passthrough_safe_text' => NULL, + ), 'template' => 'twig_extension_test.filter', ), 'twig_extension_test_function' => array( diff --git a/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.trans.html.twig b/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.trans.html.twig index 4653f6b..7d1d406 100644 --- a/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.trans.html.twig +++ b/core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.trans.html.twig @@ -69,7 +69,13 @@ {# Test trans tag with complex tokens. #} -{% set token = {'name': 'complex token', 'numbers': '12345', 'bad_text': '' } %} +{% + set token = { + 'name': 'complex token', + 'numbers': '12345', + 'bad_text': '', + } +%} {% set count = token|length %}
{% trans %}