check_plain

Versions
mediamosa-21
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.

see drupal_validate_utf8().

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.

▾ 176 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.
authorize_run_operation in includes/authorize.inc
Run the operation specified in $_SESSION['authorize_operation']
block_admin_display_form in modules/block/block.admin.inc
Generate 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().
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_tokens in modules/comment/comment.tokens.inc
Implements hook_tokens().
contact_category_list in modules/contact/contact.admin.inc
Categories/list tab.
dblog_event in modules/dblog/dblog.admin.inc
Menu callback; displays details about a log message.
devel_node_access_block_view in sites/all/modules/devel/devel_node_access.module
devel_query_table in sites/all/modules/devel/devel.module
Adds a table at the bottom of the page cataloguing data on all the database queries that were made to generate the page.
devel_themer_ajax_variables in sites/all/modules/devel/devel_themer.module
A menu callback used by popup to retrieve variables from cache for a recent page.
devel_variable_form in sites/all/modules/devel/devel.module
dprint_r in sites/all/modules/devel/devel.module
Pretty-print a variable to the browser (no krumo). Displays only for users with proper permissions. If you want a string returned instead of a print, use the 2nd param.
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
Format an attribute string to insert in a tag.
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_deliver_page in includes/common.inc
Deliver a page callback result to the browser in the format appropriate.
drupal_get_title in includes/path.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/path.inc
Set the title of the current page, for display on the page and in the title bar.
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 a listing of fields display settings for a bundle.
field_ui_field_edit_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents the field instance edit page.
field_ui_field_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; listing of fields for a bundle.
file_create_htaccess in includes/file.inc
Creates an .htaccess file in the given directory.
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.
form_process_radios in includes/form.inc
Roll out a single radios element to a list of radios, using the options array as index.
form_select_options in includes/form.inc
Convert 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
Format an internal Drupal link.
locale_date_format_form in modules/locale/locale.admin.inc
Provide date localization configuration options to users.
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.
mediamosa_app_view in sites/all/modules/mediamosa/core/node/mediamosa_node_mediamosa_app.inc
Implements hook_view().
mediamosa_batch_jobs_delete_confirm in sites/all/modules/mediamosa/modules/batch_jobs/mediamosa_batch_jobs.callbacks.inc
Callback function to display a confirmation form for deletion.
mediamosa_batch_jobs_log in sites/all/modules/mediamosa/modules/batch_jobs/mediamosa_batch_jobs.callbacks.inc
Callback function to display the contents of a log.
mediamosa_browse_asset_list_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_asset.inc
Form builder; asset listing page.
mediamosa_browse_collection_list_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_collection.inc
Form builder; collection listing page.
mediamosa_maintenance_browse_errorcode_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_errorcode.inc
The main browse form.
mediamosa_maintenance_browse_revision_form in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_revision.inc
Show listing of the revisions (of our nodes).
mediamosa_server_view in sites/all/modules/mediamosa/core/node/mediamosa_node_mediamosa_server.inc
Implements hook_view().
mediamosa_statistics_collection_latest_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_collection_latest.inc
mediamosa_statistics_collection_popular_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_collection_popular.inc
mediamosa_statistics_diskspaceused_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_diskspaceusage.inc
mediamosa_statistics_mediafile_latest_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_mediafile_latest.inc
mediamosa_statistics_mediafile_popular_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_mediafile_popular.inc
mediamosa_statistics_popularstreams_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_popularstreams.inc
mediamosa_statistics_streamrequests_list_form in sites/all/modules/mediamosa/modules/statistics/mediamosa_statistics_streamrequests.inc
mediamosa_transcode_profile_view in sites/all/modules/mediamosa/core/node/mediamosa_node_mediamosa_transcode_profile.inc
Implements hook_view().
menu_block_info in modules/menu/menu.module
Implements hook_block_info().
menu_block_view in modules/menu/menu.module
Implements hook_block_view().
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_alter().
openid_user_identities in modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
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
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.
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_delete_form_submit in modules/system/system.admin.inc
Process system_actions_delete form submissions.
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_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.
t in includes/bootstrap.inc
Translate strings to the page language or a given language.
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_term_title in modules/taxonomy/taxonomy.module
Title callback for term pages.
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_taxonomy_term in modules/taxonomy/taxonomy.module
Process variables for taxonomy-term.tpl.php.
template_preprocess_username in includes/theme.inc
Preprocess variables for theme_username().
template_preprocess_user_profile_category in modules/user/user.pages.inc
Process variables for user-profile-category.tpl.php.
theme_aggregator_block_item in modules/aggregator/aggregator.module
Format an individual feed item for display in the block.
theme_aggregator_page_opml in modules/aggregator/aggregator.pages.inc
Theme the OPML feed output.
theme_authorize_report in includes/theme.maintenance.inc
Generate a report of the results from an operation run via authorize.php.
theme_button in includes/form.inc
Theme a button form element.
theme_coder_review_warning in sites/all/modules/coder/coder_review/coder_review.module
Format a coder_review warning to be included in results.
theme_dashboard_disabled_block in modules/dashboard/dashboard.module
Theme a disabled block, for display in dashboard customization mode.
theme_file_icon in modules/file/file.module
Return an image with an appropriate icon for the given file.
theme_file_link in modules/file/file.module
Output a link to a file.
theme_file_upload_help in modules/file/file.field.inc
Generate help text based on upload validators.
theme_hidden in includes/form.inc
Theme a hidden form element.
theme_image in includes/theme.inc
Return a themed image.
theme_image_button in includes/form.inc
Theme a image button form element.
theme_image_resize_summary in modules/image/image.admin.inc
Theme callback for image resize effect summary output.
theme_image_style_preview in modules/image/image.admin.inc
Theme callback for displaying a preview of an image style.
theme_link in includes/theme.inc
Return a themed link.
theme_links in includes/theme.inc
Return a themed set of links.
theme_locale_languages_overview_form in modules/locale/locale.admin.inc
Theme the language overview form.
theme_mediamosa_maintenance_browse_properties in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse.inc
Our asset/collection detail view.
theme_mediamosa_maintenance_browse_revision_info in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_revision.inc
Show information of revision.
theme_mediamosa_maintenance_date in sites/all/modules/mediamosa/maintenance/mediamosa_maintenance.admin.inc
Our default themed date.
theme_mediamosa_maintenance_table in sites/all/modules/mediamosa/maintenance/mediamosa_maintenance.admin.inc
Our default themed table.
theme_menu_admin_overview in modules/menu/menu.admin.inc
Theme the menu title and description for admin page
theme_menu_local_action in includes/menu.inc
Generate the HTML output for a single local action link.
theme_menu_local_task in includes/menu.inc
Generate the HTML output for a single local task link.
theme_node_admin_overview in modules/node/content_types.inc
theme_radio in includes/form.inc
Theme a radio button form element.
theme_textarea in includes/form.inc
Theme a textarea form element.
theme_textfield in includes/form.inc
Theme a textfield form element.
theme_update_report in modules/update/update.report.inc
Theme project status report.
tracker_page in modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.
trigger_unassign_submit in modules/trigger/trigger.admin.inc
Submit callback for trigger_unassign() form.
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.
url in includes/common.inc
Generate a URL.
url_is_external in includes/common.inc
Return TRUE if a path is external (e.g. http://example.com).
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
Generate XML representing the given value.
_block_render_blocks in modules/block/block.module
Render the content and subject for a set of blocks.
_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_full_links in modules/filter/filter.module
Make links out of absolute URLs.
_filter_url_parse_partial_links in modules/filter/filter.module
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
_mediamosa_maintenance_revision_line in sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_revision.inc
Helper for row line.
_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 1452

<?php
function check_plain($text) {
  // We do not want to use drupal_static() since PHP version will never change
  // during a request.
  static $php525;

  if (!isset($php525)) {
    $php525 = version_compare(PHP_VERSION, '5.2.5', '>=');
  }
  // We duplicate the preg_match() to validate strings as UTF-8 from
  // drupal_validate_utf8() here. This avoids the overhead of an additional
  // function call, since check_plain() may be called hundreds of times during
  // a request. For PHP 5.2.5+, this check for valid UTF-8 should be handled
  // internally by PHP in htmlspecialchars().
  // @see http://www.php.net/releases/5_2_5.php
  // @todo remove this when support for either IE6 or PHP < 5.2.5 is dropped.

  if ($php525) {
    return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
  }
  return (preg_match('/^./us', $text) == 1) ? htmlspecialchars($text, ENT_QUOTES, 'UTF-8') : '';
}
?>