Commit fc4f5cca authored by catch's avatar catch

Issue #2734983 by Nikhilesh Gupta, neerajsingh, dimaro, mayurjadhav: Remove...

Issue #2734983 by Nikhilesh Gupta, neerajsingh, dimaro, mayurjadhav: Remove deprecated SafeMarkup::checkPlain usages from core
parent a396f171
...@@ -568,7 +568,7 @@ function template_preprocess_form_element_label(&$variables) { ...@@ -568,7 +568,7 @@ function template_preprocess_form_element_label(&$variables) {
* Note: if the batch 'title', 'init_message', 'progress_message', or * Note: if the batch 'title', 'init_message', 'progress_message', or
* 'error_message' could contain any user input, it is the responsibility of * 'error_message' could contain any user input, it is the responsibility of
* the code calling batch_set() to sanitize them first with a function like * the code calling batch_set() to sanitize them first with a function like
* \Drupal\Component\Utility\SafeMarkup::checkPlain() or * \Drupal\Component\Utility\Html::escape() or
* \Drupal\Component\Utility\Xss::filter(). Furthermore, if the batch operation * \Drupal\Component\Utility\Xss::filter(). Furthermore, if the batch operation
* returns any user input in the 'results' or 'message' keys of $context, it * returns any user input in the 'results' or 'message' keys of $context, it
* must also sanitize them first. * must also sanitize them first.
...@@ -596,8 +596,8 @@ function template_preprocess_form_element_label(&$variables) { ...@@ -596,8 +596,8 @@ function template_preprocess_form_element_label(&$variables) {
* $nodes = \Drupal::entityTypeManager()->getStorage('node') * $nodes = \Drupal::entityTypeManager()->getStorage('node')
* ->loadByProperties(['uid' => $uid, 'type' => $type]); * ->loadByProperties(['uid' => $uid, 'type' => $type]);
* $node = reset($nodes); * $node = reset($nodes);
* $context['results'][] = $node->id() . ' : ' . SafeMarkup::checkPlain($node->label()); * $context['results'][] = $node->id() . ' : ' . Html::escape($node->label());
* $context['message'] = SafeMarkup::checkPlain($node->label()); * $context['message'] = Html::escape($node->label());
* } * }
* *
* // A more advanced example is a multi-step operation that loads all rows, * // A more advanced example is a multi-step operation that loads all rows,
...@@ -616,10 +616,10 @@ function template_preprocess_form_element_label(&$variables) { ...@@ -616,10 +616,10 @@ function template_preprocess_form_element_label(&$variables) {
* ->range(0, $limit) * ->range(0, $limit)
* ->execute(); * ->execute();
* foreach ($result as $row) { * foreach ($result as $row) {
* $context['results'][] = $row->id . ' : ' . SafeMarkup::checkPlain($row->title); * $context['results'][] = $row->id . ' : ' . Html::escape($row->title);
* $context['sandbox']['progress']++; * $context['sandbox']['progress']++;
* $context['sandbox']['current_id'] = $row->id; * $context['sandbox']['current_id'] = $row->id;
* $context['message'] = SafeMarkup::checkPlain($row->title); * $context['message'] = Html::escape($row->title);
* } * }
* if ($context['sandbox']['progress'] != $context['sandbox']['max']) { * if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
* $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; * $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
......
...@@ -1362,7 +1362,7 @@ protected function renderAsLink($alter, $text, $tokens) { ...@@ -1362,7 +1362,7 @@ protected function renderAsLink($alter, $text, $tokens) {
if ($path != '<front>') { if ($path != '<front>') {
// Use strip_tags as there should never be HTML in the path. // Use strip_tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that were // However, we need to preserve special characters like " that were
// removed by SafeMarkup::checkPlain(). // removed by Html::escape().
$path = Html::decodeEntities($this->viewsTokenReplace($alter['path'], $tokens)); $path = Html::decodeEntities($this->viewsTokenReplace($alter['path'], $tokens));
// Tokens might contain <front>, so check for <front> again. // Tokens might contain <front>, so check for <front> again.
...@@ -1562,7 +1562,7 @@ public function getRenderTokens($item) { ...@@ -1562,7 +1562,7 @@ public function getRenderTokens($item) {
// Use strip tags as there should never be HTML in the path. // Use strip tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that // However, we need to preserve special characters like " that
// were removed by SafeMarkup::checkPlain(). // were removed by Html::escape().
$tokens["{{ raw_arguments.$arg }}"] = isset($this->view->args[$count]) ? strip_tags(Html::decodeEntities($this->view->args[$count])) : ''; $tokens["{{ raw_arguments.$arg }}"] = isset($this->view->args[$count]) ? strip_tags(Html::decodeEntities($this->view->args[$count])) : '';
$count++; $count++;
} }
......
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