Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_domain($url)
- {
- $pieces = parse_url($url);
- $domain = isset($pieces['host']) ? $pieces['host'] : '';
- if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
- return $regs['domain'];
- }
- return false;
- }
- parent::initialize();
- $this->loadComponent('Flash');
- if(get_domain($this->request->env('HTTP_HOST')) != get_domain($this->request->referer()) && $this->request->referer() != '/'){
- exit('ntm');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement