Issue #2196821 by JiriK: Convert all calls & docs references to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in contact module.

8.0.x
Nathaniel Catchpole 2014-02-20 12:10:22 +00:00
parent 66fc881cfe
commit 24495d5a01
3 changed files with 7 additions and 4 deletions

View File

@ -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'));
}

View File

@ -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.

View File

@ -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()),
);
}
}