function twitter_views_handler_field_xss::render in Twitter 7.3
Same name and namespace in other branches
- 6.5 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 6.2 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 6.3 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 6.4 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 7.6 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 7.4 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
- 7.5 twitter_views_field_handlers.inc \twitter_views_handler_field_xss::render()
Render the field.
Parameters
array $values: The values retrieved from the database.
Overrides views_handler_field::render
File
- ./
twitter_views_field_handlers.inc, line 45 - Views handlers for Twitter module.
Class
- twitter_views_handler_field_xss
- Process Twitter-style @usernames and URLs before filtering XSS.
Code
function render($values) {
$value = $values->{$this->field_alias};
if (!empty($this->options['link_urls'])) {
$filter = new stdClass();
$filter->settings = array(
'filter_url_length' => 496,
);
$value = _filter_url($value, $filter);
}
if (!empty($this->options['link_usernames'])) {
$value = _twitter_filter_text($value, '@', variable_get('twitter_host', TWITTER_HOST) . '/');
}
if (!empty($this->options['link_hashtags']) && valid_url($this->options['hashtags_url'])) {
$value = _twitter_filter_text($value, '#', url($this->options['hashtags_url']));
}
return filter_xss($value);
}