You are here

function views_lazy_load_plugin_display_extender::isExcludedUserAgent in Views Lazy Load 7

Same name and namespace in other branches
  1. 8 includes/views/views_lazy_load_plugin_display_extender.inc \views_lazy_load_plugin_display_extender::isExcludedUserAgent()

Check the user agent string to see if it's one of our excluded agents.

Return value

bool TRUE if the current user agent should be excluded otherwise FALSE.

1 call to views_lazy_load_plugin_display_extender::isExcludedUserAgent()
views_lazy_load_plugin_display_extender::pre_execute in includes/views/views_lazy_load_plugin_display_extender.inc
Set up any variables on the view prior to execution.

File

includes/views/views_lazy_load_plugin_display_extender.inc, line 51
A display extender plugin for lazy loading a view.

Class

views_lazy_load_plugin_display_extender
@file A display extender plugin for lazy loading a view.

Code

function isExcludedUserAgent() {
  $user_agent = $_SERVER['HTTP_USER_AGENT'];
  $excluded_user_agents = views_lazy_load_get_excluded_user_agents();
  return (bool) preg_match("/{$excluded_user_agents}/i", $user_agent);
}