Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.     /**
  2.      * determines if we should turn off turbo mode
  3.      *
  4.      * @return bool
  5.      */
  6.     protected function _robotnikWins()
  7.     {
  8.         if ($this->getRequest()->isAjax() || isset($_COOKIE['noturbo']) || isset($_COOKIE['bot'])) {
  9.             return true;
  10.         }
  11.  
  12.         if (isset($_GET['noturbo'])) {
  13.             setcookie('noturbo', true, time() + 86400);
  14.             return true;
  15.         }
  16.  
  17.         if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot') !== false) {
  18.             setcookie('bot', true, time() + 86400);
  19.             return true;
  20.         }
  21.  
  22.         return false;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement