Commit c26a7b03 authored by catch's avatar catch

Issue #2089461 by thedavidmeister, deneo, Alan D., longwave, dsdeiz,...

Issue #2089461 by thedavidmeister, deneo, Alan D., longwave, dsdeiz, stpaultim: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in core/lib.
parent 769bd1f9
......@@ -9,6 +9,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\SortArray;
use Drupal\Component\Utility\String;
use Symfony\Component\Validator\ConstraintViolationInterface;
/**
......@@ -74,7 +75,7 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
if ($this->handlesMultipleValues() || isset($get_delta)) {
$delta = isset($get_delta) ? $get_delta : 0;
$element = array(
'#title' => check_plain($this->fieldDefinition->getLabel()),
'#title' => String::checkPlain($this->fieldDefinition->getLabel()),
'#description' => field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription())),
);
$element = $this->formSingleElement($items, $delta, $element, $form, $form_state);
......@@ -161,7 +162,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
$id_prefix = implode('-', array_merge($parents, array($field_name)));
$wrapper_id = drupal_html_id($id_prefix . '-add-more-wrapper');
$title = check_plain($this->fieldDefinition->getLabel());
$title = String::checkPlain($this->fieldDefinition->getLabel());
$description = field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription()));
$elements = array();
......
......@@ -108,8 +108,8 @@ public function __construct(ModuleHandlerInterface $module_handler) {
* - sanitize: A boolean flag indicating that tokens should be sanitized for
* display to a web browser. Defaults to TRUE. Developers who set this
* option to FALSE assume responsibility for running filter_xss(),
* check_plain() or other appropriate scrubbing functions before displaying
* data to users.
* String::checkPlain() or other appropriate scrubbing functions before
* displaying data to users.
*
* @return string
* Text with tokens replaced.
......@@ -200,7 +200,7 @@ public function scan($text) {
* encoding or truncation to a specific length.
* - sanitize: A boolean flag indicating that tokens should be sanitized for
* display to a web browser. Developers who set this option to FALSE assume
* responsibility for running filter_xss(), check_plain() or other
* responsibility for running filter_xss(), String::checkPlain() or other
* appropriate scrubbing functions before displaying data to users.
*
* @return array
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment