reverted: --- b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php +++ a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php @@ -11,7 +11,6 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\editor\Entity\Editor; use Drupal\filter\Plugin\FilterInterface; @@ -326,7 +325,7 @@ $possible_format_tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre'); foreach ($possible_format_tags as $tag) { $input = '<' . $tag . '>TEST'; + $output = trim(check_markup($input, $editor->id())); - $output = trim(check_markup($input, $editor->id(), LanguageInterface::LANGCODE_NOT_SPECIFIED)); if ($input == $output) { $format_tags[] = $tag; } diff -u b/core/modules/filter/filter.module b/core/modules/filter/filter.module --- b/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -11,6 +11,7 @@ use Drupal\Component\Utility\String; use Drupal\Component\Utility\Xss; use Drupal\Core\Cache\Cache; +use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Render\Element; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; @@ -445,9 +446,9 @@ * @param string $format_id * The machine name of the filter format to be used to filter the text. * @param string $langcode - * The language code of the text to be filtered, e.g. 'en' for English. This - * allows filters to be language-aware so language-specific text replacement - * can be implemented. + * (optional) The language code of the text to be filtered, e.g. 'en' for + * English. This allows filters to be language-aware so language-specific text + * replacement can be implemented. Defaults to 'und'. * @param array $filter_types_to_skip * (optional) An array of filter types to skip, or an empty array (default) * to skip no filter types. All of the format's filters will be applied, @@ -462,7 +463,7 @@ * * @ingroup sanitization */ -function check_markup($text, $format_id, $langcode, $filter_types_to_skip = array()) { +function check_markup($text, $format_id, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, $filter_types_to_skip = array()) { $build = array( '#type' => 'processed_text', '#text' => $text, diff -u b/core/modules/filter/src/Tests/FilterAPITest.php b/core/modules/filter/src/Tests/FilterAPITest.php --- b/core/modules/filter/src/Tests/FilterAPITest.php +++ b/core/modules/filter/src/Tests/FilterAPITest.php @@ -59,7 +59,7 @@ $text = "

Llamas are awesome!

"; $expected_filtered_text = "<p>Llamas are awesome!</p>"; - $this->assertIdentical(check_markup($text, 'crazy', LanguageInterface::LANGCODE_NOT_SPECIFIED), $expected_filtered_text, 'Filters applied in correct order.'); + $this->assertIdentical(check_markup($text, 'crazy'), $expected_filtered_text, 'Filters applied in correct order.'); } /** diff -u b/core/modules/filter/src/Tests/FilterNoFormatTest.php b/core/modules/filter/src/Tests/FilterNoFormatTest.php --- b/core/modules/filter/src/Tests/FilterNoFormatTest.php +++ b/core/modules/filter/src/Tests/FilterNoFormatTest.php @@ -7,7 +7,6 @@ namespace Drupal\filter\Tests; -use Drupal\Core\Language\LanguageInterface; use Drupal\simpletest\WebTestBase; /** @@ -38,5 +37,5 @@ // Make sure that when this text is run through check_markup() with no text // format, it is filtered as though it is in the fallback format. - $this->assertEqual(check_markup($text, NULL, LanguageInterface::LANGCODE_NOT_SPECIFIED), check_markup($text, filter_fallback_format(), LanguageInterface::LANGCODE_NOT_SPECIFIED), 'Text with no format is filtered the same as text in the fallback format.'); + $this->assertEqual(check_markup($text, NULL), check_markup($text, filter_fallback_format()), 'Text with no format is filtered the same as text in the fallback format.'); } } reverted: --- b/core/modules/views/src/Plugin/views/field/Markup.php +++ a/core/modules/views/src/Plugin/views/field/Markup.php @@ -7,7 +7,6 @@ namespace Drupal\views\Plugin\views\field; -use Drupal\Core\Language\LanguageInterface; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; @@ -54,7 +53,7 @@ } if ($value) { $value = str_replace('', '', $value); + return check_markup($value, $format); - return check_markup($value, $format, LanguageInterface::LANGCODE_NOT_SPECIFIED); } } diff -u b/core/modules/views/src/Tests/Handler/AreaTextTest.php b/core/modules/views/src/Tests/Handler/AreaTextTest.php --- b/core/modules/views/src/Tests/Handler/AreaTextTest.php +++ b/core/modules/views/src/Tests/Handler/AreaTextTest.php @@ -7,7 +7,6 @@ namespace Drupal\views\Tests\Handler; -use Drupal\Core\Language\LanguageInterface; use Drupal\views\Tests\ViewUnitTestBase; use Drupal\views\Views; @@ -59,14 +58,14 @@ $view->display_handler->handlers['header']['area']->options['format'] = filter_default_format(); $build = $view->display_handler->handlers['header']['area']->render(); - $this->assertEqual(check_markup($string, NULL, LanguageInterface::LANGCODE_NOT_SPECIFIED), drupal_render($build), 'Existent format should return something'); + $this->assertEqual(check_markup($string, NULL), drupal_render($build), 'Existent format should return something'); // Empty results, and it shouldn't be displayed . $this->assertEqual(array(), $view->display_handler->handlers['header']['area']->render(TRUE), 'No result should lead to no header'); // Empty results, and it should be displayed. $view->display_handler->handlers['header']['area']->options['empty'] = TRUE; $build = $view->display_handler->handlers['header']['area']->render(TRUE); - $this->assertEqual(check_markup($string, NULL, LanguageInterface::LANGCODE_NOT_SPECIFIED), drupal_render($build), 'No result, but empty enabled lead to a full header'); + $this->assertEqual(check_markup($string, NULL), drupal_render($build), 'No result, but empty enabled lead to a full header'); } }