Issue #2196821 by JiriK: Convert all calls & docs references to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in contact module.
parent
66fc881cfe
commit
24495d5a01
|
@ -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 @@ class CategoryListController extends ConfigEntityListController {
|
|||
$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 @@ class MessageFormController extends ContentEntityFormController {
|
|||
$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 @@ namespace Drupal\contact;
|
|||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityViewBuilder;
|
||||
use Drupal\Component\Utility\String;
|
||||
|
||||
/**
|
||||
* Render controller for contact messages.
|
||||
|
@ -28,7 +29,7 @@ class MessageViewBuilder extends EntityViewBuilder {
|
|||
$entity->content['message'] = array(
|
||||
'#type' => 'item',
|
||||
'#title' => t('Message'),
|
||||
'#markup' => check_plain($entity->getMessage()),
|
||||
'#markup' => String::checkPlain($entity->getMessage()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue