Commit 24495d5a authored by catch's avatar catch

Issue #2196821 by JiriK: Convert all calls & docs references to check_plain()...

Issue #2196821 by JiriK: Convert all calls & docs references to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in contact module.
parent 66fc881c
......@@ -6,6 +6,7 @@
namespace Drupal\contact;
use Drupal\Component\Utility\String;
use Drupal\Core\Config\Entity\ConfigEntityListController;
use Drupal\Core\Entity\EntityInterface;
......@@ -35,7 +36,7 @@ public function buildRow(EntityInterface $entity) {
$row['selected'] = t('No');
}
else {
$row['recipients'] = check_plain(implode(', ', $entity->recipients));
$row['recipients'] = String::checkPlain(implode(', ', $entity->recipients));
$default_category = \Drupal::config('contact.settings')->get('default_category');
$row['selected'] = ($default_category == $entity->id() ? t('Yes') : t('No'));
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\contact;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\ContentEntityFormController;
use Drupal\Core\Language\Language;
use Drupal\user\UserInterface;
......@@ -61,12 +62,12 @@ public function form(array $form, array &$form_state) {
$form['name']['#type'] = 'item';
$form['name']['#value'] = $user->getUsername();
$form['name']['#required'] = FALSE;
$form['name']['#markup'] = check_plain($user->getUsername());
$form['name']['#markup'] = String::checkPlain($user->getUsername());
$form['mail']['#type'] = 'item';
$form['mail']['#value'] = $user->getEmail();
$form['mail']['#required'] = FALSE;
$form['mail']['#markup'] = check_plain($user->getEmail());
$form['mail']['#markup'] = String::checkPlain($user->getEmail());
}
// The user contact form has a preset recipient.
......
......@@ -9,6 +9,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityViewBuilder;
use Drupal\Component\Utility\String;
/**
* Render controller for contact messages.
......@@ -28,7 +29,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang
$entity->content['message'] = array(
'#type' => 'item',
'#title' => t('Message'),
'#markup' => check_plain($entity->getMessage()),
'#markup' => String::checkPlain($entity->getMessage()),
);
}
}
......
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