check_plain

Definition

check_plain($text)
includes/bootstrap.inc, line 660

Description

Encode special characters in a plain-text string for display as HTML.

Uses drupal_validate_utf8 to prevent cross site scripting attacks on Internet Explorer 6.

Code

<?php
function check_plain($text) {
  return drupal_validate_utf8($text) ? htmlspecialchars($text, ENT_QUOTES) : '';
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.