Skip to content
Snippets Groups Projects
Commit 5bf67c98 authored by catch's avatar catch
Browse files

Issue #2196901 by divesh.kumar, longwave: Convert all calls & docs references...

Issue #2196901 by divesh.kumar, longwave: Convert all calls & docs references to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in language module.
parent 6dd47aba
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -5,6 +5,7 @@
* Administration functions for language.module.
*/
use Drupal\Component\Utility\String;
use Drupal\Core\Language\LanguageManager;
/**
......@@ -273,7 +274,7 @@ function template_preprocess_language_content_settings_table(&$variables) {
'data' => array(
'#prefix' => '<label>',
'#suffix' => '</label>',
'#markup' => check_plain($element[$bundle]['settings']['#label']),
'#markup' => String::checkPlain($element[$bundle]['settings']['#label']),
),
'class' => array('bundle'),
),
......
......@@ -7,6 +7,7 @@
namespace Drupal\language\Form;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\EntityFormController;
use Drupal\Core\Language\Language;
......@@ -72,7 +73,7 @@ public function validateCommon(array $form, array &$form_state) {
if (!isset($form['langcode_view']) && preg_match('@[^a-zA-Z_-]@', $form_state['values']['langcode'])) {
$this->setFormError('langcode', $form_state, $this->t('%field may only contain characters a-z, underscores, or hyphens.', array('%field' => $form['langcode']['#title'])));
}
if ($form_state['values']['name'] != check_plain($form_state['values']['name'])) {
if ($form_state['values']['name'] != String::checkPlain($form_state['values']['name'])) {
$this->setFormError('name', $form_state, $this->t('%field cannot contain any markup.', array('%field' => $form['name']['#title'])));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment