Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.         function get_domain($url)
  2.         {
  3.           $pieces = parse_url($url);
  4.           $domain = isset($pieces['host']) ? $pieces['host'] : '';
  5.           if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
  6.             return $regs['domain'];
  7.           }
  8.           return false;
  9.         }
  10.  
  11.         parent::initialize();
  12.         $this->loadComponent('Flash');
  13.         if(get_domain($this->request->env('HTTP_HOST')) != get_domain($this->request->referer()) && $this->request->referer() != '/'){
  14.             exit('ntm');
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement