Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291167

Clean Drupal way to sanitize form's default values?

$
0
0

So, let's assume there is an item named Molot's e-book reader (close enough to real life facts). And let's assume there is a form displaying all my possession.

This seems unsafe:

<?php
'#default_value'=> $item->name,
?>

But this works in a wrong way:

<?php
'#default_value'=> check_plain($item->name),
?>
It turns the name into Molot&#039;s e-book reader - not the item's name.

So what is the clean Drupal way to sanitize form's default values?


Viewing all articles
Browse latest Browse all 291167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>