check_plain

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 8 check_plain($text)

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

Also validates strings as UTF-8 to prevent cross site scripting attacks on Internet Explorer 6.

Parameters

$text The text to be checked or processed.

Return value

An HTML safe version of $text, or an empty string if $text is not valid UTF-8.

See also

drupal_validate_utf8()

Related topics

▾ 185 functions call check_plain()

aggregator_block_view in modules/aggregator/aggregator.module
Implements hook_block_view().
aggregator_categorize_items in modules/aggregator/aggregator.pages.inc
Form builder; build the page list form.
aggregator_form_feed in modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to add/edit feed sources.
batch_example_op_1 in examples/batch_example/batch_example.module
Batch operation for batch 1: load a node. This is the function that is called on each operation in batch 1.
batch_example_op_2 in examples/batch_example/batch_example.module
Batch operation for batch 2 : load all nodes, 5 by five After each group of 5 control is returned to the batch API for later continuation.
block_admin_display_form in modules/block/block.admin.inc
Form builder for the main blocks administration form.
block_form_user_profile_form_alter in modules/block/block.module
Implements hook_form_FORM_ID_alter().
block_menu in modules/block/block.module
Implements hook_menu().
check_url in includes/common.inc
Strips dangerous protocols (e.g. 'javascript:') from a URI and encodes it for output to an HTML attribute value.
color_scheme_form in modules/color/color.module
Form callback. Returns the configuration form.
CommentTokenReplaceTestCase::testCommentTokenReplacement in modules/comment/comment.test
Creates a comment, then tests the tokens generated from it.
comment_multiple_delete_confirm in modules/comment/comment.admin.inc
List the selected comments and verify that the admin wants to delete them.
comment_preview in modules/comment/comment.module
Generate a comment preview.
comment_submit in modules/comment/comment.module
Prepare a comment for submission.
comment_tokens in modules/comment/comment.tokens.inc
Implements hook_tokens().
CommonXssUnitTest::testEscaping in modules/simpletest/tests/common.test
Check that special characters are escaped.
CommonXssUnitTest::testInvalidMultiByte in modules/simpletest/tests/common.test
Check that invalid multi-byte sequences are rejected.
common_test_destination in modules/simpletest/tests/common_test.module
Print destination query parameter.
contact_category_list in modules/contact/contact.admin.inc
Categories/list tab.
database_test_theme_tablesort in modules/simpletest/tests/database_test.module
Output a form without setting a header sort.
dblog_event in modules/dblog/dblog.admin.inc
Menu callback; displays details about a log message.
debug in includes/common.inc
Debug function used for outputting debug information.
DrupalHtmlToTextTestCase::assertHtmlToText in modules/simpletest/tests/mail.test
Helper function for testing drupal_html_to_text().
DrupalHtmlToTextTestCase::stringToHtml in modules/simpletest/tests/mail.test
Converts a string to its PHP source equivalent for display in test messages.
DrupalRenderTestCase::assertRenderedElement in modules/simpletest/tests/common.test
drupal_add_html_head_link in includes/common.inc
Add a LINK tag with a distinct 'rel' attribute to the page's HEAD.
drupal_attributes in includes/common.inc
Converts an associative array to an attribute string for use in XML/HTML tags.
drupal_block_denied in includes/bootstrap.inc
Handle denied users.
drupal_deliver_html_page in includes/common.inc
Package and send the result of a page callback to the browser as HTML.
drupal_fast_404 in includes/bootstrap.inc
Returns a simple 404 Not Found page.
drupal_get_title in includes/bootstrap.inc
Get the title of the current page, for display on the page and in the title bar.
drupal_placeholder in includes/bootstrap.inc
Formats text for emphasized display in a placeholder inside a sentence. Used automatically by t().
drupal_pre_render_styles in includes/common.inc
#pre_render callback to add the elements needed for CSS tags to be rendered.
drupal_set_title in includes/bootstrap.inc
Set the title of the current page, for display on the page and in the title bar.
email_example_mail in examples/email_example/email_example.module
Implement hook_mail().
field_default_form in modules/field/field.form.inc
Create a separate form element for each field.
field_multiple_value_form in modules/field/field.form.inc
Special handling to create form elements for multiple values.
field_ui_display_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents field display settings for a given view mode.
field_ui_field_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; listing of fields for a bundle.
FileExampleSessionStreamWrapper::stream_write in examples/file_example/file_example_session_streams.inc
Support for fwrite(), file_put_contents() etc.
FileTokenReplaceTestCase::testFileTokenReplacement in modules/file/tests/file.test
Creates a file, then tests the tokens generated from it.
file_create_htaccess in includes/file.inc
Creates an .htaccess file in the given directory.
file_example_session_contents in examples/file_example/file_example.module
A utility function to allow us to see what is in a session "file".
FilterAdminTestCase::testFilterAdmin in modules/filter/filter.test
Test filter administration functionality.
FilterUnitTestCase::assertFilteredString in modules/filter/filter.test
Asserts multiple filter output expectations for multiple input strings.
filter_admin_overview in modules/filter/filter.admin.inc
Menu callback; Displays a list of all text formats and allows them to be rearranged.
filter_xss_bad_protocol in includes/common.inc
Processes an HTML attribute value and ensures it does not contain an URL with a disallowed protocol (e.g. javascript:).
format_rss_channel in includes/common.inc
Formats an RSS channel.
format_rss_item in includes/common.inc
Format a single RSS item.
format_xml_elements in includes/common.inc
Format XML elements.
FormsTestCase::testDisabledMarkup in modules/simpletest/tests/form.test
Verify markup for disabled form elements.
form_select_options in includes/form.inc
Converts a select form element's options array into an HTML.
form_test_storage_form_submit in modules/simpletest/tests/form_test.module
Form submit handler to finish multi-step form.
forum_form in modules/forum/forum.module
Implements hook_form().
hook_form in modules/node/node.api.php
Display a node editing form.
hook_node_update_index in modules/node/node.api.php
Act on a node being indexed for searching.
hook_search_execute in modules/search/search.api.php
Execute a search for a set of key words.
hook_tokens in modules/system/system.api.php
Provide replacement values for placeholder tokens.
hook_update_index in modules/search/search.api.php
Update the search index for this module.
image_style_form in modules/image/image.admin.inc
Form builder; Edit an image style name and effects order.
l in includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.
locale_date_format_form in modules/locale/locale.admin.inc
Provide date localization configuration options to users.
locale_languages_edit_form_validate in modules/locale/locale.admin.inc
Validate the language editing form. Reused for custom language addition too.
locale_languages_overview_form in modules/locale/locale.admin.inc
User interface for the language overview screen.
locale_language_url_rewrite_session in includes/locale.inc
Rewrite URLs for the Session language provider.
locale_translate_edit_form in modules/locale/locale.admin.inc
User interface for string editing.
MenuBreadcrumbTestCase::testBreadCrumbs in modules/simpletest/tests/menu.test
Tests breadcrumbs on node and administrative paths.
MenuWebTestCase::assertBreadcrumb in modules/simpletest/tests/menu.test
Assert that a given path shows certain breadcrumb links.
menu_block_info in modules/menu/menu.module
Implements hook_block_info().
menu_block_view in modules/menu/menu.module
Implements hook_block_view().
NodeTokenReplaceTestCase::testNodeTokenReplacement in modules/node/node.test
Creates a node, then tests the tokens generated from it.
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_content_form in modules/node/node.module
Implements hook_form().
node_list_permissions in modules/node/node.module
Helper function to generate standard node permission list for a given type.
node_multiple_delete_confirm in modules/node/node.admin.inc
node_search_execute in modules/node/node.module
Implements hook_search_execute().
node_tokens in modules/node/node.tokens.inc
Implements hook_tokens().
openid_form_user_register_form_alter in modules/openid/openid.module
Implements hook_form_FORM_ID_alter().
openid_test_yadis_xrds in modules/openid/tests/openid_test.module
Menu callback; XRDS document that references the OP Endpoint URL.
openid_user_identities in modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
PageTitleFiltering::testTitleTags in modules/system/system.test
Tests the handling of HTML by drupal_set_title() and drupal_get_title()
PageTitleFiltering::testTitleXSS in modules/system/system.test
Test if the title of the site is XSS proof.
poll_form in modules/poll/poll.module
Implements hook_form().
poll_teaser in modules/poll/poll.module
Creates a simple teaser that lists all the choices.
poll_view_voting in modules/poll/poll.module
Generates the voting form for a poll.
poll_votes in modules/poll/poll.pages.inc
Callback for the 'votes' tab for polls you can see other votes on
profile_admin_overview in modules/profile/profile.admin.inc
Form builder to display a listing of all editable profile fields.
profile_admin_settings_autocomplete in modules/profile/profile.admin.inc
Retrieve a pipe delimited string of autocomplete suggestions for profile categories
profile_autocomplete in modules/profile/profile.pages.inc
Callback to allow autocomplete of profile text fields.
profile_block_configure in modules/profile/profile.module
Implements hook_block_configure().
profile_browse in modules/profile/profile.pages.inc
Menu callback; display a list of user information.
profile_form_alter in modules/profile/profile.module
Implements hook_form_alter().
profile_user_view in modules/profile/profile.module
Implements hook_user_view().
profile_view_field in modules/profile/profile.module
SearchCommentTestCase::testSearchResultsComment in modules/search/search.test
Verify that comments are rendered using proper format in search results.
search_excerpt in modules/search/search.module
Returns snippets from a piece of text, with certain keywords highlighted. Used for formatting search results.
shortcut_set_admin in modules/shortcut/shortcut.admin.inc
Menu page callback: builds the page for administering shortcut sets.
shortcut_set_switch in modules/shortcut/shortcut.admin.inc
Form callback: builds the form for switching shortcut sets.
shortcut_set_title in modules/shortcut/shortcut.module
Returns the title of a shortcut set.
simpletest_example_form in examples/simpletest_example/simpletest_example.module
Implements hook_form().
st in includes/install.inc
Functional equivalent of t(), used when some systems are not available.
statistics_access_log in modules/statistics/statistics.admin.inc
Menu callback; Displays recent page accesses.
system_actions_manage in modules/system/system.admin.inc
Menu callback; Displays an overview of available and configured actions.
system_date_time_settings in modules/system/system.admin.inc
Form builder; Configure the site date and time settings.
system_file_system_settings in modules/system/system.admin.inc
Form builder; Configure the site file handling.
system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.
system_tokens in modules/system/system.tokens.inc
Implements hook_tokens().
system_update_7003 in modules/system/system.install
Update {blocked_ips} with valid IP addresses from {access}.
system_update_7013 in modules/system/system.install
Convert default time zone offset to default time zone name.
system_update_7067 in modules/system/system.install
Grant administrators permission to view the administration theme.
t in includes/bootstrap.inc
Translates a string to the current language or to a given language.
TableSortTest::testTableSortInit in modules/simpletest/tests/tablesort.test
Test tablesort_init().
TaxonomyTokenReplaceTestCase::testTaxonomyTokenReplacement in modules/taxonomy/taxonomy.test
Creates some terms and a node, then tests the tokens generated from them.
taxonomy_admin_vocabulary_title_callback in modules/taxonomy/taxonomy.module
Return the vocabulary name given the vocabulary object.
taxonomy_autocomplete in modules/taxonomy/taxonomy.pages.inc
Helper function for autocompletion
taxonomy_field_formatter_view in modules/taxonomy/taxonomy.module
Implements hook_field_formatter_view().
taxonomy_overview_vocabularies in modules/taxonomy/taxonomy.admin.inc
Form builder to list and manage vocabularies.
taxonomy_tokens in modules/taxonomy/taxonomy.tokens.inc
Implements hook_tokens().
template_preprocess_aggregator_item in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-item.tpl.php.
template_preprocess_aggregator_summary_item in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-summary-item.tpl.php.
template_preprocess_aggregator_summary_items in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-summary-items.tpl.php.
template_preprocess_book_export_html in modules/book/book.module
Process variables for book-export-html.tpl.php.
template_preprocess_book_navigation in modules/book/book.module
Process variables for book-navigation.tpl.php.
template_preprocess_book_node_export_html in modules/book/book.module
Process variables for book-node-export-html.tpl.php.
template_preprocess_field in modules/field/field.module
Theme preprocess function for theme_field() and field.tpl.php.
template_preprocess_forum_list in modules/forum/forum.module
Process variables to format a forum listing.
template_preprocess_forum_topic_list in modules/forum/forum.module
Preprocess variables to format the topic listing.
template_preprocess_html in includes/theme.inc
Preprocess variables for html.tpl.php
template_preprocess_node in modules/node/node.module
Process variables for node.tpl.php
template_preprocess_poll_bar in modules/poll/poll.module
Preprocess the poll_bar theme hook.
template_preprocess_poll_results in modules/poll/poll.module
Preprocess the poll_results theme hook.
template_preprocess_poll_vote in modules/poll/poll.module
Themes the voting form for a poll.
template_preprocess_profile_block in modules/profile/profile.module
Process variables for profile-block.tpl.php.
template_preprocess_search_result in modules/search/search.pages.inc
Process variables for search-result.tpl.php.
template_preprocess_search_results in modules/search/search.pages.inc
Process variables for search-results.tpl.php.
template_preprocess_taxonomy_term in modules/taxonomy/taxonomy.module
Process variables for taxonomy-term.tpl.php.
template_preprocess_username in includes/theme.inc
Preprocesses variables for theme_username().
template_preprocess_user_profile_category in modules/user/user.pages.inc
Process variables for user-profile-category.tpl.php.
TextFieldTestCase::_testTextfieldWidgetsFormatted in modules/field/modules/text/text.test
Helper function for testTextfieldWidgetsFormatted().
theme_aggregator_block_item in modules/aggregator/aggregator.module
Returns HTML for an individual feed item for display in the block.
theme_aggregator_page_opml in modules/aggregator/aggregator.pages.inc
Prints the OPML page for a feed.
theme_dashboard_disabled_block in modules/dashboard/dashboard.module
Returns HTML for a disabled block, for display in dashboard customization mode.
theme_file_icon in modules/file/file.module
Returns HTML for an image with an appropriate icon for the given file.
theme_file_link in modules/file/file.module
Returns HTML for a link to a file.
theme_file_upload_help in modules/file/file.field.inc
Returns HTML for help text based on file upload validators.
theme_filter_guidelines in modules/filter/filter.module
Returns HTML for guidelines for a text format.
theme_image_resize_summary in modules/image/image.admin.inc
Returns HTML for a summary of an image resize effect.
theme_image_style_preview in modules/image/image.admin.inc
Returns HTML for a preview of an image style.
theme_link in includes/theme.inc
Returns HTML for a link.
theme_links in includes/theme.inc
Returns HTML for a set of links.
theme_locale_languages_overview_form in modules/locale/locale.admin.inc
Returns HTML for the language overview form.
theme_menu_admin_overview in modules/menu/menu.admin.inc
Returns HTML for a menu title and description for the menu overview page.
theme_menu_local_action in includes/menu.inc
Returns HTML for a single local action link.
theme_menu_local_task in includes/menu.inc
Returns HTML for a single local task link.
theme_node_admin_overview in modules/node/content_types.inc
Returns HTML for a node type description for the content type admin overview page.
theme_profile_admin_overview in modules/profile/profile.admin.inc
Returns HTML for the profile field overview form into a drag and drop enabled table.
theme_queue_items in examples/queue_example/queue_example.module
Themes the queue display.
theme_textarea in includes/form.inc
Returns HTML for a textarea form element.
theme_trigger_display in modules/trigger/trigger.admin.inc
Returns HTML for the form showing actions assigned to a trigger.
theme_update_report in modules/update/update.report.inc
Returns HTML for the project status report.
theme_user_admin_roles in modules/user/user.admin.inc
Returns HTML for the role order and new role form.
TokenReplaceTestCase::testSystemSiteTokenReplacement in modules/system/system.test
Tests the generation of all system site information tokens.
TokenReplaceTestCase::testTokenReplacement in modules/system/system.test
Creates a user and a node, then tests the tokens generated from them.
toolbar_menu_navigation_links in modules/toolbar/toolbar.module
Generate a links array from a menu tree array.
tracker_page in modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.
update_do_one in includes/update.inc
Perform one update and store the results for display on finished page.
update_manager_update_form in modules/update/update.manager.inc
Build the form for the update manager page to update existing projects.
UserTokenReplaceTestCase::testUserTokenReplacement in modules/user/user.test
Creates a user, then tests the tokens generated from it.
user_admin_permissions in modules/user/user.admin.inc
Menu callback: administer permissions.
user_autocomplete in modules/user/user.pages.inc
Menu callback; Retrieve a JSON object containing autocomplete suggestions for existing users.
user_multiple_cancel_confirm in modules/user/user.module
user_tokens in modules/user/user.tokens.inc
Implements hook_tokens().
xmlrpc_value_get_xml in includes/xmlrpc.inc
Generates XML representing the given value.
_block_render_blocks in modules/block/block.module
Render the content and subject for a set of blocks.
_drupal_decode_exception in includes/errors.inc
Decode an exception, especially to retrive the correct caller.
_drupal_render_exception_safe in includes/errors.inc
Render an error message for an exception without any possibility of a further exception occurring.
_filter_html_escape in modules/filter/filter.module
Escapes all HTML tags, so they will be visible instead of being effective.
_filter_html_tips in modules/filter/filter.module
Filter tips callback for HTML filter.
_filter_url_parse_email_links in modules/filter/filter.module
preg_replace callback to make links out of e-mail addresses.
_filter_url_parse_full_links in modules/filter/filter.module
preg_replace callback to make links out of absolute URLs.
_filter_url_parse_partial_links in modules/filter/filter.module
preg_replace callback to make links out of domain names starting with "www."
_locale_languages_configure_form_language_table in modules/locale/locale.admin.inc
Helper function to build a language provider table.
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_node_index_node in modules/node/node.module
Index a single node.
_text_sanitize in modules/field/modules/text/text.module
Sanitizes the 'value' or 'summary' data of a text value.

Code

includes/bootstrap.inc, line 1523

<?php
function check_plain($text) {
  return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}
?>