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 @@ ...@@ -9,6 +9,7 @@
use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\SortArray; use Drupal\Component\Utility\SortArray;
use Drupal\Component\Utility\String;
use Symfony\Component\Validator\ConstraintViolationInterface; use Symfony\Component\Validator\ConstraintViolationInterface;
/** /**
...@@ -74,7 +75,7 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s ...@@ -74,7 +75,7 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
if ($this->handlesMultipleValues() || isset($get_delta)) { if ($this->handlesMultipleValues() || isset($get_delta)) {
$delta = isset($get_delta) ? $get_delta : 0; $delta = isset($get_delta) ? $get_delta : 0;
$element = array( $element = array(
'#title' => check_plain($this->fieldDefinition->getLabel()), '#title' => String::checkPlain($this->fieldDefinition->getLabel()),
'#description' => field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription())), '#description' => field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription())),
); );
$element = $this->formSingleElement($items, $delta, $element, $form, $form_state); $element = $this->formSingleElement($items, $delta, $element, $form, $form_state);
...@@ -161,7 +162,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f ...@@ -161,7 +162,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
$id_prefix = implode('-', array_merge($parents, array($field_name))); $id_prefix = implode('-', array_merge($parents, array($field_name)));
$wrapper_id = drupal_html_id($id_prefix . '-add-more-wrapper'); $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())); $description = field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription()));
$elements = array(); $elements = array();
......
...@@ -108,8 +108,8 @@ public function __construct(ModuleHandlerInterface $module_handler) { ...@@ -108,8 +108,8 @@ public function __construct(ModuleHandlerInterface $module_handler) {
* - sanitize: A boolean flag indicating that tokens should be sanitized for * - sanitize: A boolean flag indicating that tokens should be sanitized for
* display to a web browser. Defaults to TRUE. Developers who set this * display to a web browser. Defaults to TRUE. Developers who set this
* option to FALSE assume responsibility for running filter_xss(), * option to FALSE assume responsibility for running filter_xss(),
* check_plain() or other appropriate scrubbing functions before displaying * String::checkPlain() or other appropriate scrubbing functions before
* data to users. * displaying data to users.
* *
* @return string * @return string
* Text with tokens replaced. * Text with tokens replaced.
...@@ -200,7 +200,7 @@ public function scan($text) { ...@@ -200,7 +200,7 @@ public function scan($text) {
* encoding or truncation to a specific length. * encoding or truncation to a specific length.
* - sanitize: A boolean flag indicating that tokens should be sanitized for * - sanitize: A boolean flag indicating that tokens should be sanitized for
* display to a web browser. Developers who set this option to FALSE assume * 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. * appropriate scrubbing functions before displaying data to users.
* *
* @return array * @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