diff --git a/core/lib/Drupal/Component/Utility/SafeMarkup.php b/core/lib/Drupal/Component/Utility/SafeMarkup.php index 920335f..0d50cd6 100644 --- a/core/lib/Drupal/Component/Utility/SafeMarkup.php +++ b/core/lib/Drupal/Component/Utility/SafeMarkup.php @@ -64,23 +64,6 @@ public static function isSafe($string, $strategy = 'html') { } /** - * Safely concatenates strings by escaping any that are not known to be safe. - * - * @param string ... - * An unlimited number of string parameters to concatenate. - * - * @return \Drupal\Component\Utility\SafeMarkup|string - * The concatenated string, which is now also marked as safe. - * - * @todo - * Should this (instead or additionally) accept an array of strings as a - * parameter? - */ - public static function concat() { - return SafeMarkup::implode('', func_get_args()); - } - - /** * Safely implodes strings by escaping any that are not known to be safe. * * @param string $delimiter diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 4053a5c..fd20bcb 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -943,10 +943,10 @@ function file_save_upload($form_field_name, $validators = array(), $destination '#theme' => 'item_list', '#items' => $errors, ); - $message = SafeMarkup::concat($message, drupal_render($item_list)); + $message = SafeMarkup::implode('', array($message, drupal_render($item_list))); } else { - $message = SafeMarkup::concat($message, ' ', array_pop($errors)); + $message = SafeMarkup::implode('', array($message, ' ', array_pop($errors))); } drupal_set_message($message, 'error'); $files[$i] = FALSE; diff --git a/core/modules/system/src/Tests/System/DateFormatsMachineNameTest.php b/core/modules/system/src/Tests/System/DateFormatsMachineNameTest.php index a6f9189..34052dc 100644 --- a/core/modules/system/src/Tests/System/DateFormatsMachineNameTest.php +++ b/core/modules/system/src/Tests/System/DateFormatsMachineNameTest.php @@ -49,8 +49,7 @@ public function testDateFormatsMachineNameAllowedValues() { 'date_format_pattern' => 'Y-m-d', ); $this->drupalPostForm('admin/config/regional/date-time/formats/add', $edit, t('Add format')); - // @todo Revisit for a better solution. - $this->assertText(String::checkPlain('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".'), 'It is not possible to create a date format with the machine name that has any character other than lowercase letters, digits or underscore.'); + $this->assertText(t('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".'), 'It is not possible to create a date format with the machine name that has any character other than lowercase letters, digits or underscore.'); // Try to create a date format with the reserved machine name "custom". $edit = array( @@ -59,8 +58,7 @@ public function testDateFormatsMachineNameAllowedValues() { 'date_format_pattern' => 'Y-m-d', ); $this->drupalPostForm('admin/config/regional/date-time/formats/add', $edit, t('Add format')); - // @todo Revisit for a better solution. - $this->assertText(String::checkPlain('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".'), 'It is not possible to create a date format with the machine name "custom".'); + $this->assertText(t('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".'), 'It is not possible to create a date format with the machine name "custom".'); // Try to create a date format with a machine name, "fallback", that // already exists. diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index c85ac89..01f7795 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -543,7 +543,7 @@ function template_preprocess_views_view_table(&$variables) { '#style' => $initial, ); $markup = drupal_render($tablesort_indicator); - $label = SafeMarkup::concat($label, $markup); + $label = SafeMarkup::implode('', array($label, $markup)); } $query['order'] = $field; @@ -634,7 +634,7 @@ function template_preprocess_views_view_table(&$variables) { $field_output = $handler->getField($num, $field); $element_type = $fields[$field]->elementType(TRUE, TRUE); if ($element_type) { - $field_output = SafeMarkup::concat(SafeMarkup::set('<' . $element_type . '>'), $field_output, SafeMarkup::set('')); + $field_output = SafeMarkup::implode('', array(SafeMarkup::set('<' . $element_type . '>'), $field_output, SafeMarkup::set(''))); } // Only bother with separators and stuff if the field shows up. @@ -642,13 +642,13 @@ function template_preprocess_views_view_table(&$variables) { // Place the field into the column, along with an optional separator. if (!empty($column_reference['content'])) { if (!empty($options['info'][$column]['separator'])) { - $column_reference['content'] = SafeMarkup::concat($column_reference['content'], Xss::filterAdmin($options['info'][$column]['separator'])); + $column_reference['content'] = SafeMarkup::implode('', array($column_reference['content'], Xss::filterAdmin($options['info'][$column]['separator']))); } } else { $column_reference['content'] = ''; } - $column_reference['content'] = SafeMarkup::concat($column_reference['content'], $field_output); + $column_reference['content'] = SafeMarkup::implode('', array($column_reference['content'], $field_output)); } } $column_reference['attributes'] = new Attribute($column_reference['attributes']);