Drupal security reference

1. Always use check_plain(), check_markup(), filter_xss() while you process input data.
2. For Drupal set message use placeholders (or) sanitize using one of check_plain(), check_markup & filter_xss()
placeholder example:
$output = 'coming from somewhere';
drupal_set_message(t('this is @output', array('@output' => $output)));
sanitize example:
$output = 'coming from somewhere';
drupal_set_message(check_plain(t('this is '. $output));

Comments

Popular posts from this blog

Programatically create layout builder section in Drupal

Code quality analysis of Drupal. Can I use Sonar?

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)